var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
I need to find out the Max Date of a Particular Year in a table.
How do i do this
select max(date_col) from tbl where to_char(date_col,'RRRR') = '2004'
What happens if i dont have the Date as the input.
suppose i have 15 records for year 2004 and 15 records for 2005 ..
and so on...
I need a query that can give me the Max date of that particular year
for all the years that are there in the table
Hope this is clear
"for all the years that are there in the table"
You neglected to mention this the first time.
select to_char(date_col,'RRRR') yr, max(date_col) max_date
group by to_char(date_col,'RRRR')
order by yr