How to compare timestamp in sql server -


given following table, how can select recent timestamp given user?

here table:

enter image description here

for instance, if userid 5, want compare every userid 5 timestamp , return recent timestamp.

not sure if understand correctly?

maybe simple that?

select max(checktime) table userid = 5 

if not, google over clause.


Comments