[SQL ] 抓取不同月份數值的交集已刪文

看板Database作者 (嘿嘿嘿)時間2年前 (2022/03/21 06:28), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
資料庫名稱: MySQL/Snowflake 資料庫版本: 2021 內容/問題描述: 各位資深前輩好: 我想要抓取 class 1,2,3,4,5 左下角是2月份,右上角是1月份的資料 示意圖如下: https://i.imgur.com/zmK0N1t.jpg
請問有沒有辦法從下列code去更改呢? 請各位大大幫忙了,謝謝 ==== select segment, case when bad_sets.set_uuid is not null then 'bad user set' else 'good use r set' end as is_disabled, count(user_set_id) as user_count from analytics.segmentation join analytics.user_sets using (user_set_id) left join dau.bad_sets on user_set_id = set_uuid where score_date = '2022-02-01' and first_country_code in ('US', 'CA') group by 1, 2; Code跑出來的table如下: https://i.imgur.com/NgqOPoS.jpg
==== -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 65.129.155.202 (美國) ※ 文章網址: https://www.ptt.cc/bbs/Database/M.1647815286.A.D53.html
文章代碼(AID): #1YDwfsrJ (Database)