Hi I have 3 tables:
ITEM
BID
BUY
This is what I have:
SELECT Item.itemID, Item.itemDescription
FROM ITEM
INNER JOIN Bid ON item.itemID = bid.itemID
INNER JOIN Buy ON item.lotID = buy.lotID
WHERE "my conditions"
ORDER "my order"
The problem here is, it will only return records when a entry exists in all the above tables with the same itemID, but the thing is, that the entry will exist in the table ITEM and EITHER BID or BUY. It cannot exist in both BID and BUY only one or the other.
So how do I join the tables so it will return records when the item exists in ITEM and EITHER BID or BUY ???
I have tried using a union statement but keep getting errors about "operator must have an equal number of expressions in their target lists".
Thanks in advance.
ITEM
BID
BUY
This is what I have:
SELECT Item.itemID, Item.itemDescription
FROM ITEM
INNER JOIN Bid ON item.itemID = bid.itemID
INNER JOIN Buy ON item.lotID = buy.lotID
WHERE "my conditions"
ORDER "my order"
The problem here is, it will only return records when a entry exists in all the above tables with the same itemID, but the thing is, that the entry will exist in the table ITEM and EITHER BID or BUY. It cannot exist in both BID and BUY only one or the other.
So how do I join the tables so it will return records when the item exists in ITEM and EITHER BID or BUY ???
I have tried using a union statement but keep getting errors about "operator must have an equal number of expressions in their target lists".
Thanks in advance.