Attached is a spreadsheet. I have this data in a table "asm" I need to produce the columns:
col E - Parent
col F - Prior Peer
col G - NextPeer
col H - Child
The numbers in the columns E, F, G, H are the "AssemblySeq" numbers. How would I write a sql server 2012 CTE procedure to derive these values in col E-H?
Please provide complete SQL statement.