You need SORT
desc
function on column start_Date
. Below is the query which will produce your desired result.
select * from table1
order by Start_Date desc;
You can check sqlfiddle demo here
If the dates are in future, you have to use asc
to get your desired result.
select * from table1
order by Start_Date asc;
If your dates are mix of Past and future dates like below sample data.
ID Name Start_Date
---------------------
1 abc 2018-01-01
2 efg 2018-02-05
3 pqr 2018-01-16
4 xyz 2018-02-19
1 abc 2017-01-01
2 efg 2017-02-05
3 pqr 2017-01-16
4 xyz 2017-02-19
Below query can be a option to show data in more friendly format.
select * from (
select * from table1
where start_date < current_date
order by start_date desc
) as B
union
select 0,'TODAY_DATE', current_date
union
select * from (
select * from table1
where start_date > current_date
order by start_date asc
) as A
It will sort past dates data in desc
order, then add TODAY
date to result and then add future data in asc
format as below.
ID Name Start_Date
--------------------------
4 xyz 2017-02-19
2 efg 2017-02-05
3 pqr 2017-01-16
1 abc 2017-01-01
0 TODAY_DATE 2017-08-18
1 abc 2018-01-01
3 pqr 2018-01-16
2 efg 2018-02-05
4 xyz 2018-02-19
check SQLfiddle demo here