query data based on time column but display data id wise

Posted by Sriharim under Sql Server on 8/5/2018 | Points: 10 | Views : 135 | Status : [Member] | Replies : 0
I have below table id,entity and value,time (ordered by time). Query the data based on time descending order. output display should sorted by ID ascending order and entity ascending order

ID Entity Value Time
2 6 5 2018-09-09 13:59:00.000
2 2 -42 2018-09-09 12:54:00.000
2 4 15 2018-09-09 12:50:00.000
3 4 10 2018-09-09 12:45:00.000
5 4 15 2018-09-09 12:40:00.000
3 4 15 2018-09-09 12:38:00.000
4 4 15 2018-09-09 12:35:00.000
2 3 5 2018-09-09 12:24:00.000


My Output would be


ID Entity Value Time
2 6 5 2018-09-09 13:59:00.000
2 2 -42 2018-09-09 12:54:00.000
2 4 15 2018-09-09 12:50:00.000
3 4 10 2018-09-09 12:45:00.000
5 4 15 2018-09-09 12:40:00.000


Mark as Answer if its helpful to you
---
Srihari



Responses

(No response found.)

Login to post response