各位,我數(shù)據(jù)庫(kù)里created_time存的是字符串類型,如何查詢一天當(dāng)中每小時(shí)的數(shù)據(jù)量,這sql怎么寫?
1 回答

波斯汪
TA貢獻(xiàn)1811條經(jīng)驗(yàn) 獲得超4個(gè)贊
可以使用分段查詢:
select * from (select count(*) from you_table where 第一個(gè)小時(shí)的區(qū)間 ) as one, (select count(*) from you_table where 第二個(gè)小時(shí)的區(qū)間 ) as two, ...
添加回答
舉報(bào)
0/150
提交
取消