Question
SELECT * FROM table WHERE id NOT IN? Help with statement.
Hi,
Two tables. Orders (orderID = PK) and Paid Orders (orderID = FK)
I want to display a recordset of orders from the Orders table where the
order ID doesn't appear in the Paid Orders table.
I have tried something like this:
SELECT *
FROM dbo.tblOrders
WHERE orderID NOT IN ( SELECT TOP 100 PERCENT tblPaidOrders.orderID FROM
dbo.tblPaidOrders )
...no joy with that though. Would appreciate some guidance. Thank you.
Regards
Nath.
Two tables. Orders (orderID = PK) and Paid Orders (orderID = FK)
I want to display a recordset of orders from the Orders table where the
order ID doesn't appear in the Paid Orders table.
I have tried something like this:
SELECT *
FROM dbo.tblOrders
WHERE orderID NOT IN ( SELECT TOP 100 PERCENT tblPaidOrders.orderID FROM
dbo.tblPaidOrders )
...no joy with that though. Would appreciate some guidance. Thank you.
Regards
Nath.