0
嗨快速mysql的問題,香港專業教育學院得到這個當前查詢什麼讓我頭疼MySQL查詢左連接錯誤
SELECT stafflist.id, stafflist.full_name, (wages.wage /5) * stafflist.avgworkingdays AS workingwage ,
count(sick.d) AS DaysOffSick, variables.value AS VAT, count(hols.d) AS Prebooked_Holidays,
((((wages.wage /5) * stafflist.avgworkingdays)/stafflist.avgworkingdaysmonth)*count(sick.d)) AS daysoffsickvalue,
((((((wages.wage/5) * stafflist.avgworkingdays) * 3) /100) * (100 + variables.value))/ (stafflist.avgworkingdaysmonth)) * (stafflist.avgworkingdaysmonth
- count(hols.d)) AS Commision_target_After_Holidays
from stafflist
LEFT JOIN wages ON wages.wagesid = stafflist.WageGrade
LEFT JOIN variables ON variables.company=stafflist.company and variables.name = 'VAT'
LEFT JOIN off AS sick ON sick.StaffMember = stafflist.id and sick.isitsick=1 AND sick.addedtowages=0
LEFT JOIN off As hols ON hols.StaffMember = stafflist.id and hols.isitsick=0 AND hols.addedtowages=0 AND hols.m = MONTH(now()) -1 AND hols.prebooked=1
WHERE stafflist.id = 48
GROUP By stafflist.full_name
問題是我希望它算多少天被標記爲病人和多少作爲節假日 然而,一旦我離開再次加入關閉表並將它命名爲hols領域daysoffsick拉標記爲假期的日子
請你幫我這個
問候 巴蒂爾
那麼什麼是...在查詢中的錯誤?我只能看到括號和悲傷。 –