日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

---随心买统计查询

發(fā)布時間:2025/7/25 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ---随心买统计查询 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

---隨心買統(tǒng)計查詢

--隨心買新增-當日人次
select COUNT(*) from(select distinct userID from HUR_Product_Buy where createDate between '2016-07-12 00:00:00' and '2016-07-12 23:59:59') as a
--隨心買新增-累計總?cè)舜?br />union all select COUNT(*) from(select distinct userID from HUR_Product_Buy where createDate between '1980-01-01' and '2016-07-12 23:59:59') as b

--隨心買新增-當日金額
union all select SUM(amount) from HUR_Product_Buy where createDate between '2016-07-11 00:00:00' and '2016-07-11 23:59:59'
--隨心買新增-累計總金額
union all select SUM(amount) from HUR_Product_Buy where createDate between '1980-01-01' and '2016-07-11 23:59:59'


--隨心買退出-當日人次
union all select COUNT(*) from(select distinct userID from HUR_Product_Buy where (status=2 or status=3) and updateDate between '2016-07-11 00:00:00' and '2016-07-11 23:59:59') as c
--隨心買退出-累計總?cè)舜?br />union all select COUNT(*) from(select distinct userID from HUR_Product_Buy where (status=2 or status=3) and updateDate between '1980-01-01' and '2016-07-11 23:59:59') as d

--隨心買退出-當日金額
union all select SUM(amount) from HUR_Product_Buy where (status=2 or status=3) and updateDate between '2016-07-12 00:00:00' and '2016-07-12 23:59:59'
--隨心買退出-累計總金額
union all select SUM(amount) from HUR_Product_Buy where (status=2 or status=3) and updateDate between '1980-01-01' and '2016-07-12 23:59:59'

?

?

?


select * from(
select ext.exitID,ext.exitAmount,ext.createDate,ext.exitStatus,
(select username from YYD_Users_RegInfo where id = ext.userID) username,
(select amount from HUR_Product_Buy where buyID = ext.buyID) amount,
(select rankName from HUR_Product_Buy where buyID = ext.buyID) rankName
from HUR_Product_Exit as ext) as data where 1=1

select * from HUR_Product_Buy order by createDate desc

select SUM(amount) as TotalextAmount from(select buy.buyID,buy.amount,buy.status,buy.platform,buy.updateDate,
(select username from YYD_Users_RegInfo where id = buy.userID) username from HUR_Product_Buy as buy where (status=2 or status=3)) as data

where username like '%dd%'


select buy.buyID,buy.amount,buy.status,buy.platform,buy.updateDate,
(select username from YYD_Users_RegInfo where id = buy.userID) username from HUR_Product_Buy as buy where (status=2 or status=3)



轉(zhuǎn)載于:https://www.cnblogs.com/zxtceq/p/5703723.html

總結(jié)

以上是生活随笔為你收集整理的---随心买统计查询的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。