oracle - SQL "Where" syntax for is today -


i need entrys curdate today... curdate of type timestamp. of course searched in google think have used wrong keywords.

select * ftt.element fee, ftt.plan p  p.id=ftt.p_id , curdate ???  order p_id, curdate desc; 

could provide me?

sysdate returns current datea and time in oracle. date column contains time part in oracle - timestamp column well.

in order check "today" must remove time part in both values:

select *  ftt.element fee   join ftt.plan p on p.id=ftt.p_id  trunc(curdate) = trunc(sysdate) order p_id, curdate desc; 

you should used using explicit joins instead of implicit joins in where clause.

if need take care of different timezones (e.g. because curdate timestamp time zone) might want use current_timestamp (which includes time zone) instead of sysdate


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -