select Location_Description, COUNT(B.Transaction_Number) AS [No Sales] from ejtable as A inner join ejmediatable as B
on A.Transaction_Number = B.Transaction_Number RIGHT OUTER JOIN locationtable C
on A.Location_Number = C.Location_Number
where (a.transaction_number IN
(select transaction_number from ejmediatable where mediatype=99)) and receipt_date_time > '2-01-2007' and receipt_date_time <'3-1-2007'
GROUP BY Location_Description以上Query是查寻数据库中No Sales的次数,我使用了Right Outer Join但是结果和用Left Outter Join, Inner Join是一样的.
其中用到了3个表,EJTable,EJMediaTable,LocationTable
请高手指点问题出在哪里.谢谢!
on A.Transaction_Number = B.Transaction_Number RIGHT OUTER JOIN locationtable C
on A.Location_Number = C.Location_Number
where (a.transaction_number IN
(select transaction_number from ejmediatable where mediatype=99)) and receipt_date_time > '2-01-2007' and receipt_date_time <'3-1-2007'
GROUP BY Location_Description以上Query是查寻数据库中No Sales的次数,我使用了Right Outer Join但是结果和用Left Outter Join, Inner Join是一样的.
其中用到了3个表,EJTable,EJMediaTable,LocationTable
请高手指点问题出在哪里.谢谢!
A表 right join B表時,A表是從表,B表是主表,此時B表的數據會全部顯示出來