Home Forums SQL Server 2012 SQL Server 2012 - T-SQL Querying a Supersession Two Column Table with Multiple Supersessions in both Columns RE: Querying a Supersession Two Column Table with Multiple Supersessions in both Columns

  • I didn't realise there was a third part to the query. The second part returns all of the supersessions (6 rows) of the chosen number, in the PartNo column - so, that looks good.

    The third part returns no rows at all.

    Edit: Ok, well after having it operate on a live table with 40,000+ part numbers, I can say it works about 30% of the time.

    I think columns like this ...

    Old No | New No

    1080 | 1080FC

    1080F | 1080FC

    1080FA | 1080FC

    1080FB | 1080FC

    ... seem to throw it a little bit. If you search for 1080, it returns (OriginalPart) 1080, (PartNo) 1080FC, (PNPrior) 1080 and skips the other numbers entirely.

    It would probably help if you could see the data in a larger context.

    Thanks for your continued help.