is insert based on select on one of the column in MySQL possible?

后端 未结 3 1801
没有蜡笔的小新
没有蜡笔的小新 2021-01-17 20:30

Is following insert based on select on one of the column possible in MySQL

INSERT INTO student_fees(id, name, fees) 
VALUES(1, SELECT name from students          


        
3条回答
  •  北荒
    北荒 (楼主)
    2021-01-17 21:06

    try this:

    INSERT INTO student_fees(id, name, fees) 
    Select 1, name,'200$' from students 
    

提交回复
热议问题