q***@gmail.com
2014-10-25 10:35:52 UTC
In MS SQL Server 2012:
How do one get only the last inserted row (stime) for each user?
user |sdate |stime
--------------------
user1|20141024|134400
user1|20141024|163000
user1|20141024|162800
user2|20141024|070700
user2|20141024|165500
user3|20141024|074100
user3|20141024|151400
user3|20141024|121100
Expected result:
user |sdate |stime
--------------------
user1|20141024|163000
user2|20141024|165500
user3|20141024|151400
//UE
How do one get only the last inserted row (stime) for each user?
user |sdate |stime
--------------------
user1|20141024|134400
user1|20141024|163000
user1|20141024|162800
user2|20141024|070700
user2|20141024|165500
user3|20141024|074100
user3|20141024|151400
user3|20141024|121100
Expected result:
user |sdate |stime
--------------------
user1|20141024|163000
user2|20141024|165500
user3|20141024|151400
//UE