I am new with sql server. i am trying to compare two tables (items, catalog), between unique code (itemsID) and 3 catalogs IDs (catalogID1, catalogID2, catalogID3). after the comparison, i want to see itemDescription (with the condition/comparison i set). I wrote the query below, but i can't execute the query with 3 conditions (items.itemsID = catalog.catalogID1 and items.itemsID = catalog.catalogID2 and items.itemsID = catalog.catalogID3), but if i execute each condition by it self (for example, items.itemsID = catalog.catalogID1), it does execute. How it possible to execute it with all the 3 conditions? Any suggestion will be grateful.
select items.itemsDescription
from items, catalog
where items.itemsID = catalog.catalogID1 and items.itemsID = catalog.catalogID2 and items.itemsID = catalog.catalogID3