query data based on time column but display data id wise

Posted by Sriharim under Sql Server on 8/5/2018 | Points: 10 | Views : 467 | Status : [Member] | Replies : 1
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

Posted by: Baba12 on: 8/23/2018 [Member] Starter | Points: 25

Up
0
Down
baba12,

Sriharim, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response