1

I have a table, that all other columns have the same values, only one difference, this column is result from another select statement.

I need somethings like

INSERT INTO my_table (orgid, status, userid )
    VALUES(12393, true, SELECT u.userid FROM user u)

I can use a loop statement with many insert statement inside, but i want something more easy, 1 sqlQuery and dont use of functions :-?

1 Answer 1

4

Try this :

INSERT INTO my_table (orgid, status, userid )
SELECT 12393, true, u.userid FROM user u
Sign up to request clarification or add additional context in comments.

Comments

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.