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