SarahDeng
asked on
Compare Oracle Date TIME with sql
Experts,
This is an urgent request. I need compare the colume of datetime type (e.g. 06/21/2008 11:30:00pm) with a timestampe like (e.g 06/21/2008 10:40:35). what is quick way to do that?
select * from mytable
where mydatetime > '06/20/2008 10:40:35pm'
This is an urgent request. I need compare the colume of datetime type (e.g. 06/21/2008 11:30:00pm) with a timestampe like (e.g 06/21/2008 10:40:35). what is quick way to do that?
select * from mytable
where mydatetime > '06/20/2008 10:40:35pm'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you can compare them directly in sql if not hardcoding values so:
SELECT sysdate - SYSTIMESTAMP FROM dual
select * from table where date_col > timestamp_col
http://www.psoug.org/reference/timestamp.html
SELECT sysdate - SYSTIMESTAMP FROM dual
select * from table where date_col > timestamp_col
http://www.psoug.org/reference/timestamp.html
ASKER