[Solved] How to query for the following SQL Server table? [closed]
Try this code: select id, max(case when seqcnt = -1 then frequency end) [oldfrequency], max(case when seqcnt = 1 then frequency end) [newfrequency] from ( –this subquery will create new column named seqCnt, which will be equal to: — -1 when this is the first seqno — 1 if this is the last seqno — … Read more