Hello,
i have two tables with a date column, where i want to join. I need in the comparison onle the year and not the complete date.
What is the fastest method to compare only the year of the two date columns?
Must i convert the date column to a char YEAR? Something like that:
select c1, c2 from tab1 t1, tab2 t2 where to_char(t1.c1,'YYYY') = to_char(t2.c2,'YYYY')
Or is there a better method for that - e.g. not to convert the date to a char but to a number??? In other programming languages converting to a number and make the comparison is normally faster - isn“t it?
Thank you very much
Best reagrds
Heidi