Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to select by time only?

rade.todorovichDec 6 2015 — edited Dec 6 2015

Oracle DB 12c

I have a table with a DATE column (among others). I want to select rows just by comparing time portion.

I tried the following but neither gave me correct result (working_start_time is the DATE column)

select to_char(working_start_time,'MMDDYYYY HH:MI AM'),a.* from sch_availability a

where working_start_time >= to_date('08:00 AM','HH:MI AM');

select to_char(working_start_time,'MMDDYYYY HH:MI AM'),a.* from sch_availability a

where to_char(working_start_time,'HH:MI AM') >= '08:00 AM';

So how do I find all rows where time is greater than 8 AM (regardless of date)?

This post has been answered by Paulzip on Dec 6 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 3 2016
Added on Dec 6 2015
5 comments
2,590 views