SELECT frs_Employee.empnin, empname, COUNT( frs_Payment.empnin ) AS Transaction
FROM frs_Employee, frs_Payment
GROUP BY frs_Payment.empnin
当我编译它时,它给了我相同的名字,但正确的数字。我怎么能让这些名字有所不同?
答案 0 :(得分:0)
您需要在empnin上加入表格。您还需要将empname添加到GROUP BY。
SELECT frs_Employee.empnin
, empname
, COUNT( frs_Payment.empnin ) AS Transaction
FROM frs_Employee,
INNER JOIN frs_Payment on frs_Payment.empnin = frs_Employee.empnin
GROUP BY frs_Employee.empnin, empname