Hi,I have some records which can be an extension of themselves.e.g.id value amendmentId1 10 NULL2 20 NULL3 10 14 5 NULL5 39 1
When I do a select I want them to come out in the following orderid value amendmentId1 10 NULL3 10 15 39 12 20 NULL4 5 NULL
Was going to do it like this is there a better way?SELECT id , ISNULL(amendmentId,Id) groupId) ,value FROM TABLEGROUP BY ISNULL(amendmentId, Id) ,id ,value
Hope this makes some sense!