sql >> データベース >  >> RDS >> Mysql

グループ間のmysqlユーザーサインアップカウント

    select date, SUM(case when subscriber = 1 and s2member_level2 = 0 then 1 else 0 end) subscriber,
               SUM(case when s2member_level2 = 1 then 1 else 0 end) s2member_level2
    from
    (   select  date(user_registered) date,
                 id,
                sum(case when B.meta_key = "wp_capabilities" then 1 else 0 end) as subscriber,
                sum(case when B.meta_key = "wp_s2member_subscr_id" then 1 else 0 end) as s2member_level2
        from wp_users A LEFT JOIN wp_usermeta B ON A.Id = B.user_id            
        group by date(user_registered), id
    ) C
    group by date
    


    1. MariaDB JSON_DETAILED()の説明

    2. mysqlテーブルから選択WHEREfield='$ array'?

    3. タイムゾーンを読み込めませんか?

    4. SQLiteとは