How to compare two DATE values based only on date part in Oracle?

后端 未结 5 2272
醉话见心
醉话见心 2021-02-19 18:53

I am trying to get counts for last 30 days with the following query -

SELECT date_occured, COUNT(*) FROM problem
WHERE date_occured >= (CURRENT_DATE - 30)
GRO         


        
5条回答
  •  暖寄归人
    2021-02-19 19:30

    Try using SYSDATE vs CURRENT_DATE. Sysdate uses the server's local time where CURRENT_DATE returns current date/time for the server in the client's connection's local time.

提交回复
热议问题