Home > database > Available for a group group ~ ~ of the SQL statement
Available for a group group ~ ~ of the SQL statement
Time:09-28
Like this, first by name group (database personId fields), and then sort by time (timestamp) in the group, and then according to each person's latest record time for the whole set of sorting, Could you tell me how to write SQL that each master ah, I really can't figure out ~ PS: don't tube diagram form time, artists literally written,
CodePudding user response:
Select * from ( Select *, row_number () over (partition by personId order by timestamp desc) as rids the from tableName ) a The order by rids, timestamp desc