Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select *
- from table
- where account+time in (select account+max(time)
- from table
- group by account
- order by time)
- select T1.account, T1.value
- from table T as T1
- where T1 = (select max(T2.time) from table T as T2 where T1.account = T2.Account)
- SELECT TOP 1 * FROM TableName ORDER BY Time DESC
- select account,last(value),max(time)
- from table
- group by account
Add Comment
Please, Sign In to add comment