並前往https://dba.stackexchange.com/questions/315005/sql-multiple-case-conditions-with-sum-and-count-functions-along-with-join-condit