场景:分组,计数,并找出从A进入过的用户
SELECT uid ,COUNT(*)AS readnum,SUM(CASE WHEN event_paralist['entrance']='A' THEN '1' ELSE '0' END)AS bookcase
FROM table
WHERE ds='2017-03-28'
GROUP BY uid;
场景:分组,计数,并找出从A进入过的用户
SELECT uid ,COUNT(*)AS readnum,SUM(CASE WHEN event_paralist['entrance']='A' THEN '1' ELSE '0' END)AS bookcase
FROM table
WHERE ds='2017-03-28'
GROUP BY uid;