0
我有一個名爲Call_Data表和數據的樣子:組合兩個時間間隔查詢
Arr_Date Interval Han_Time SL_Time
2011-03-16 18:39:31.000 1830 1200 245
2011-03-16 20:06:03.000 2000 261 85
2011-03-31 00:35:42.000 0030 1900 400
2011-03-31 02:13:06.000 0200 2000 350
現在我想知道,有Han_time> 1800 SL_Time> 300
這樣的記錄數我寫了兩個查詢來做到這一點:
Select Arr_Date, Interval,
Count(*) AS Han_Time_1800
From Call_Data
where Han_Time>1800
Group by Arr_Date,Interval
Order by Arr_Date,Interval
Select Arr_Date, Interval,
Count(*) AS SL_Time_300
From Call_Data
where SL_Time>300
Group by Arr_Date,Interval
Order by Arr_Date,Interval
是否有一種方法,我可以在一個查詢中得到兩個值?
沒有如果Han_time is1900什麼,SL_time是250 – Peter