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')
如何将数据插入Order_No列。
答案 0 :(得分:1)
你可以试试这个
INSERT INTO master_table (`Group_No`, `Group_Name`,`Order_No`)
SELECT 6,'Purchase Account',Order_no FROM acc_group_master where Group_No=1
答案 1 :(得分:0)
您已使用引号'..'
包围子查询,使其成为字符串并按原样插入数据库中,只需删除引号并应用括号
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))
答案 2 :(得分:0)
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)
答案 3 :(得分:0)
试试这个
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))