的問題如下:比較兩個時間之間的平均purchase_amount範圍
有多高是在早上(05-11),平均購買量相比,(17-23)在晚上?
我不知道如何比較它們。
我試過這個,但我只得到一大筆錢。
select avg(purchase_amount)
from case_data_order
where cast (create_timestamp as time) between '05:00:00' and '11:00:00'
or cast(create_timestamp as time) between '17:00:00' and '23:00:00';
我用的Postgres 9.6
謝謝!有效!!! –