0

So this is the query I am trying, definately doesnt work.

The subquery returns 3 rows, which I want copied to the new table.

INSERT INTO retired
VALUES (SELECT * from questions where status = 'R');

I was sure looking at it I was doing it wrong, but here is specifically the question:

Do I need to list all the columns separately, or is there a way to tell it just to move the whole row? The tables attributes and columns are identical.

1

1 Answer 1

3

If questions and retired have the same columns (quantity and type), then this should work:

INSERT INTO retired
SELECT * from questions where status = 'R';
Sign up to request clarification or add additional context in comments.

1 Comment

I see what I did wrong. Thank you. I guess I didnt realize I would not need VALUES to do it this way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.