我有这样的查询。
SELECT account.AccountNumber, account.Name, Sum(agro.price*agro.qty) AS Expr1
FROM account,data INNER JOIN (agro INNER JOIN data ON agro.BillNo = data.BillNo) ON
account.AccountNumber = data.acno
GROUP BY account.AccountNumber, account.Name;
我想添加其中db ='true'此列是'数据'表格,那我该怎么办请帮助我?
答案 0 :(得分:1)
试试这个:
SELECT account.AccountNumber, account.NAME, Sum(agro.price * agro.qty) AS Expr1
FROM ((account
INNER JOIN data ON account.AccountNumber = data.acno)
INNER JOIN agro ON agro.BillNo = data.BillNo)
WHERE data.db='true'
GROUP BY account.AccountNumber, account.NAME;
你的JOIN中有一些混乱,但我认为这是你的目标