The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.
PrimaryKey, Score, DateField 1, 50, 1/1/2016 2, 12, 1/1/2016 1, 75, 1/12/2016 1, 80, 1/15/2016 2, 35, 1/16/2016
PrimaryKey, Score, LastScore, OtherFields... 1, 80, 75, data... 2, 35, 12, data...
select a.RTPropertyUniqueIdentifier, max(case when seqnum = 1 then Scores end) as score, max(case when seqnum = 2 then Scores end) as score_previous from (select a.*, row_number() over (partition by RTPropertyUniqueIdentifier order by LoadDate desc) as seqnum from PROPERTY_SCORE a ) a where seqnum <= 2 -- This should help performance of the `group by` group by a.RTPropertyUniqueIdentifier
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.