0
爲什麼下面的SQL查詢返回錯誤?DISTINCT COUNT返回SQL錯誤
SELECT COUNT (DISTINCT rm.id)
FROM ts_room rm
LEFT JOIN ts_roomfacilities rf
ON rm.id = rf.room_id
LEFT JOIN ts_facilities f
ON f.id = rf.facilities_id
LEFT JOIN ts_building b
ON rm.building_id=b.id;
看起來合乎邏輯乍一看!
這裏是我的SQLFiddle - http://sqlfiddle.com/#!2/a59fc/20