下面是我的查询,我收到“子查询返回超过 1 行”错误:
INSERT INTO billing_temp (`billing_period_id`,`soc_id`,`bill_y_n`)
VALUES(
(SELECT `id` FROM `billing_period` ORDER BY `billing_start_date` DESC LIMIT 0,1),
(SELECT `id` FROM `milk_producer` WHERE active='1'),
'N'
)
SELECT `id` FROM `billing_period` ORDER BY `billing_start_date` DESC LIMIT 0,1
返回多个值。
我希望这些多个值将插入到表中,例如:
1 03 N
2 03 N
3 03 N