I have a table where i am trying to stop duplicate entries of a product. Table example:
UniqueID MainID ProductID
====== ====== =========
001 AA ABC123
002 AA ABC456
003 AA ABD789
004 BB ABC123
005 BB ABC456
SO, if MAINID = 'AA' AND (there is more than one instance of product 'ABC123') then i would like it to return the offending ProductID/s that have more than one entry for MAINID 'AA'.
Hope this makes sense
ps. I cannot do this using indexes - must be queried.
UniqueID MainID ProductID
====== ====== =========
001 AA ABC123
002 AA ABC456
003 AA ABD789
004 BB ABC123
005 BB ABC456
SO, if MAINID = 'AA' AND (there is more than one instance of product 'ABC123') then i would like it to return the offending ProductID/s that have more than one entry for MAINID 'AA'.
Hope this makes sense
ps. I cannot do this using indexes - must be queried.