I have one table, I want to sort by years. However, we have a problem.
The column is in text format. Because it is in the years before Christ.
First I need to list the years before Christ and then the present years.
order by the column
event_year, but replacing
'B.C ' by a minus sign
'-', and converting it to a
select * from date_events order by cast(replace(event_year, 'B.C ', '-') as signed);
Answered By – Zakaria
Answer Checked By – Gilberto Lyons (BugsFixing Admin)