Reputation: 362
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 :-?
Upvotes: 1
Views: 160
Reputation: 18569
Try this :
INSERT INTO my_table (orgid, status, userid )
SELECT 12393, true, u.userid FROM user u
Upvotes: 4