Having a bit of trouble with this.Need to find the record with the 'earliest date', with the year irrelevant. So if my table has03-07-80 (DD-MM-YY)06-12-1223-01-90Then 23-01 should be the earliest date. This works, but only finding the minimum date, not just the DD and MM part.select min(date1), year1from tablewhere date1 = ( select min(date1) from table )group by year1, date1;
If I try changing it toselect to_char(min(date1),'DD-MM'), year1from tablewhere date1 = ( select to_char(min(date1),'DD-MM') from table )group by year1, date1;
I get an invalid month error? And I'm not 100% sure on whether the to_char(min(date1),'DD-MM' is the right way to do it.Any help would be much appreciated.