常用sql
按日期累加
SELECT b.`date` ,(SELECT SUM(price) FROM bkk a WHERE a.`date`<= b.`date` ) FROM bkk b
======================================================================================
SELECT a.`date`,COUNT(numberId)"点击人数",
(SELECT COUNT(numberId) FROM buy WHERE buy.`date`= a.`date`)"购买人数",
(SELECT COUNT(numberId) FROM pay WHERE pay.`date`= a.`date`)"付款人数"
FROM product a GROUP BY a.`date`
product
buy
pay