0
BUSES
----------------
|BUS_NO
|BUS_NAME
|TYPE
|AVAIL_SEAT
我必須計算總共有多少個AC
和NON AC
總線?sql查詢統計兩種類型的單個物品
我對count
查詢:
count(*)bus_count
sum(case when type='ac' then 1 else 0)
sum (case when type="non ac" then 1 else 0)
from buses
group by bus_number;