SQL Language (MOSC)

MOSC Banner

Using like with date columns

edited Mar 10, 2013 12:07AM in SQL Language (MOSC) 10 commentsAnswered ✓
Hello,
I have a column with data type DATE, when I do:
col_date = '07-MAR-2013'
Doesn't return any rows, which I can understand because of hours, minutes and seconds that are not shown, but when i do:
col_date like '07-MAR-2013'

It returns me rows that have 07-MAR-2013 on its value no matter what hours, minutes and seconds, like :
07-MAR-2013 01:57:13
07-MAR-2013 09:30:24
07-MAR-2013 16:10:33
07-MAR-2013 16:10:31
07-MAR-2013 16:22:46
07-MAR-2013 16:22:47
07-MAR-2013 16:39:33
07-MAR-2013 16:44:31

Does LIKE puts an implicit % at the beginning and end for the date values? Doesn't happen when I am working with varchar2.

Thanks,

Daniel

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center