Oracle comparing years in dates

Suppose you have two dates and you want to compares the years rather the exact date. Make sure you know the format of the dates. The use the following code:

to_char(to_date(somedate, 'yyyymmdd'), 'YYYY') = to_char(to_date(somedate, 'yyyymmdd'), 'YYYY')

Change yyyymmdd to your date format.

This example have been tested on Oracle 8i, 9i, 10g, and 11g.