比方说,我有如下表:MYSQL:选择
ID, Name ,insurance , per_diem, net_salary, rr, rent, other_allowances
1, John 1000 0 2000 0 0 0
2, Jim 1000 0 2000 0 0 0
3, Steve 500 0 3000 0 0 0
4, Tom 0 0 0 0 0 0
我运行下面的查询
SELECT Sum((((((applicant.insurance + applicant.per_diem) +
applicant.net_salary) + applicant.rr) + applicant.rent) +
applicant.other_allowances)) As available_fund
WHERE applicant.id = id;
From applicant
我想要得到的东西好像和每个人
是它可能?
如果你发布你的错误越来越多,人们可能会更快地提供帮助。在你的例子中,FROM ...子句应该在WHERE子句之前......另外,WHERE子句中的条件似乎没有意义。最后,你并不需要太多括号。 –
SQL部分中的次要格式更改 –