INSERT INTO master_table (`Group_No`, `Group_Name`,`Order_No`) VALUES (6,'Purchase Account','SELECT Order_no FROM acc_group_master where Group_No=1')
How can i insert data into Order_No column.
INSERT INTO master_table (`Group_No`, `Group_Name`,`Order_No`) VALUES (6,'Purchase Account','SELECT Order_no FROM acc_group_master where Group_No=1')
How can i insert data into Order_No column.
你可以试试这个
INSERT INTO master_table (`Group_No`, `Group_Name`,`Order_No`)
SELECT 6,'Purchase Account',Order_no FROM acc_group_master where Group_No=1
您已经用引号包围了您的子查询,'..'
使其成为一个字符串并按原样插入到您的数据库中,只需删除引号并应用括号即可
INSERT INTO master_table (`Group_No`, `Group_Name`,`Order_No`)
VALUES (6,'Purchase Account',(SELECT Order_no FROM acc_group_master where Group_No=1))
INSERT INTO master_table (`Group_No`, `Group_Name`,`Order_No`) VALUES
(SELECT 6, 'purchase Account', Order_no FROM acc_group_master where Group_No=1)
尝试这个
INSERT INTO master_table (`Group_No`, `Group_Name`,`Order_No`) VALUES
(6,'Purchase Account',(SELECT Order_no FROM acc_group_master where Group_No=1))