子查询返回多于1行,输入数据以最小值传递


Insert into graduated (id_graduated , id_results)
VALUES ('L1',(SELECT id_results FROM results WHERE score >= 40));

使用INSERT ... SELECT语法:

INSERT INTO graduated (id_graduated, id_results)
SELECT 'L1', id_results FROM results WHERE score >= 40

相关内容

  • 没有找到相关文章