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!

To filter data acording to year of date field of a table

bootstrapMar 23 2010 — edited Mar 24 2010
Hi i have a table
TABLE  T1(ID NUMBER, SET_DATE DATE)
I want to select id values from this table by comparing year present in set_date field.
For that i wrote
select id from t1 where set_date like '%2010%' ;
It's returning no rows.

But the following code is working
select id from t1 where set_date like '%10%' ;
Though second code is working there is a demerit in both these code because i am not specifying to match year.It's quite possible that 10 may be present any where else, and this query will return all those rows.So how to filter rows according to year?
This post has been answered by Peter Gjelstrup on Mar 23 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 21 2010
Added on Mar 23 2010
4 comments
7,757 views