Tag Info

New answers tagged


To find the latest status of all message (assuming receiptID is an auto-incrementing key) you should use a window function: SELECT Status , messageID FROM (SELECT Status , messageID , Row_Number() over (partition by messageID order by receiptID desc) priority FROM Receipt) PrioritizedStatus WHERE PrioritizedStatus.priority = ...

Top 50 recent answers are included