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

  • Hi,

    Many thanks for your prompt reply and patience.

    What I'm really trying to achieve is, a user inputs a part number, ie STC8572 (the customer does not necessarily have access to or know any of the other part numbers associated with this number), the lookup table then checks for supersessions of that part number - in this case:

    (oldest number) RTC5756 > STC8572 > STC3765 > STC9150 > STC9191 > SFP500160 (newest number)

    The query then returns the newest number as the number to be used, along with the part information, which it knows based on the 'source' table, with a message such as 'The part number you have entered has been superseded to SFP500160'.

    The query will also return all of the previous numbers associated with that number, to be consumed by the application for cross reference.

    I hope this clarifies things a little bit.