[SQL ] 表格統計結果合併輸出?

看板Database作者 (優質的藍色射手)時間12年前 (2014/01/17 11:38), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/1
各位版友: 我使用 select product,count(case when tag='1' then '1' else null end) as a_row from a_table group by product; select product,count(case when tag='1' then '1' else null end) as b_row from b_table group by product; 不知道有沒有機會合併查尋,結果會變成 table_c product a_row b_row -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.160.20.82

01/17 15:10, , 1F
用JOIN不就可以了?
01/17 15:10, 1F

01/26 22:55, , 2F
看來不行~~~可能還是要分開查尋
01/26 22:55, 2F
文章代碼(AID): #1IsAMtyb (Database)