是否有可能從同一個表得到的結果如下日期明智記錄:多個子查詢
Enrolled Enrolled as Email Enrolled as Text Deals Redeemed
<First Date> 7 5 2 6
<Next Date> 9 3 6 14
表結構是這個樣子:
Customer_id, field1, field2, responsecode, created_date
我當前的查詢是什麼像這樣:
Select
Created,
Enroll = (Select COUNT(*) from tblCustomer where field1 <> '' group by created),
Email = (Select COUNT(field1) from tblCustomer where field1 = 'E-mail' and field1 <> '' group by created),
Cell = (Select COUNT(*) from tblCustomer where field1 = 'Cell Phone' and field1 <> '' group by created)
from tblCustomer
group by created
order by created
什麼是你的數據庫/表結構? – 2012-02-29 10:30:59
桌子是什麼樣的?沒有相關信息的人應該如何回答這個問題? – 2012-02-29 10:31:46
請詳細說明。你是指含有日期的記錄嗎?或者是其他東西? – 2012-02-29 10:32:46