简体   繁体   中英

SQL User Transactions

I have a table with multiple users that keeps track of application login date and time.

I am looking for a way to pull the last date they log on to the app 1 entry per user?

Column1 = userid 
Column2 = date

I have try multiple examples but none are working as bellow:

select * 
from 
    (select * 
     from ACCTRANS 
     ORDER BY TIMESTAMP DESC) AS x 
GROUP BY 
    USERID
SELECT UserId, MAX(TIMESTAMP) 
FROM ACCTRANS
GROUP BY UserId

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM