0
insert into log_file
(
table_id,
text,
today_date,
user_id
)
values
(
(select id from table where table_no in ('Table1','Table2')),
"Some Text Now",
now(),
143
);
當然,我得到的錯誤 'ERROR 1242(21000):子查詢返回多個1行的'
我怎麼能accomdate這而不必寫出很多個人查詢?
的可能的複製(HTTP:// stackoverflow.com/questions/9422529/mysql-how-do-you-insert-into-a-table-with-a-select-subquery-returning-multiple-r) –