SQL語句查詢:前7天下單【1,4】次的用戶並在近7天下單0次。(left join on)

  解題思路: 利用左連接查詢 1、把13-19號下單數量1-4筆訂單的用戶pid查詢出來,當做表1: bb  SELECT * FROM ( SELECT pid, orders FROM ( SELECT * FROM ( SELECT pid, COUNT(1) AS orders FROM 訂單表 WHERE (pay_day >= '2020-04-13' AND pay_day <=
相關文章
相關標籤/搜索