Reputation: 323
I have two column for stored time named : Time_1 | Time_2
I want to make a SQL query that select all table, then order the result by compare between Time_1 vs Time_2 to get the greater (newer) value of each row and order all result by that greater value.
Upvotes: 0
Views: 39
Reputation: 204894
select * from your_table
order by case when Time_1 >= Time_2 then Time_1
else Time_2
end desc
Upvotes: 2