select time1, time2, time3 from tableName order by time1 is null, time1 and time2 is null , time2 and time3 is null , time3