我有表due_list with
id , userid , mobno , rs , network , date_posted , time_posted
我想从due_list中选择sum(rs),其中group by userid 进入另一个表
insert into users(userid,rs,mobno,netwrok) select userid,mobno,network sum('rs') form due_list groub by userid
答案 0 :(得分:0)
2个错误。
首先:你必须使用BACKTICKS作为字段名
第二:关键字是group not groub anf FROM not FORM
INSERT INTO users (userid,rs,mobno,netwrok)
SELECT userid,mobno,network sum(`rs`)
FROM due_list group by userid;