I have a table that contains many Items....Item1, Item2, Item3...
Each of these items can have multiple id's associated with them...ID1, ID2, ID3.
I want one of every item, but only ID2 if ID1 is not available and only ID3 if ID1 and ID2 are not available.
So if I had the following data...
Item1, ID 1
Item1, ID2
Item2, ID3
Item3, ID2
Item3, ID3
I would return...
Item1, ID1
Item2, ID3
Item3, ID2
thanks...
Start Free Trial