99999久久久久久亚洲,欧美人与禽猛交狂配,高清日韩av在线影院,一个人在线高清免费观看,啦啦啦在线视频免费观看www

熱線電話:13121318867

登錄
2021-03-02 閱讀量: 1605
sql題: 查詢2019年1月1日至今,每天的注冊用戶數(shù),下單用戶數(shù),以及注冊當(dāng)天即下單的用戶數(shù)

問:

sql題:

查詢2019年1月1日至今,每天的注冊用戶數(shù),下單用戶數(shù),以及注冊當(dāng)天即下單的用戶數(shù)

image.png


答:

參考答案:

selecttable_date.reg_tm,ifnull(count( distincttable_user.user_id), 0) 注冊用戶數(shù),ifnull(count( distincttable_order.user_id), 0) 下單用戶數(shù),ifnull(count( distinctif(table_user.reg_time=table_order.order_timeand table_user.user_id=table_order.user_id,table_user.user_id,null)), 0) 下單用戶數(shù)
from(
selectreg_tm fromtable_user
union
selectorder_tm fromtable_order) astable_date
left jointable_user ontable_date.reg_tm=table_user.reg_tm
left jointable_order ontable_date.reg_tm=table_order.order_tm
wheretable_date.reg_tm>= "2019-01-01"
groupbytable_date.reg_tm;


參考文章:https://www.sohu.com/a/331210295_178408

109.0909
0
關(guān)注作者
收藏
評論(0)

發(fā)表評論

暫無數(shù)據(jù)
推薦帖子