SYSDATE
è una funzione solo Oracle.
Lo standard ANSI definisce current_date
o current_timestamp
che è supportato da Postgres e documentato nel manuale:
http://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT
(Btw: Oracle supporta CURRENT_TIMESTAMP
pure)
si dovrebbe prestare attenzione alla differenza tra current_timestamp
, statement_timestamp()
e clock_timestamp()
(che è spiegato nel manuale, vedere il link sopra)
Questa dichiarazione:
select up_time from exam where up_time like sysdate
non fa alcun senso a tutti. Né in Oracle né in Postgres. Se si desidera ottenere le righe da "oggi", avete bisogno di qualcosa di simile:
select up_time
from exam
where up_time = current_date
Si noti che in Oracle si sarebbe probabilmente vuole trunc(up_time) = trunc(sysdate)
per sbarazzarsi della parte tempo che è sempre inclusa in Oracle.
fonte
2013-06-06 11:13:31