I am trying to write a query that will only return TRUE/FALSE from within a query
Here is the query
SELECT Inventory.Item, HasPurchOrder AS (Exists(SELECT PurchOrder.Order FROM PurchOrder WHERE PurchOrder.Item = '12345' AND PurchOrder.Status = 'OPEN')) FROM Inventory WHERE Inventory.Item = '12345'
I don't want a list of purchase orders I just want a list of
Inventory items and whether or not it has a purchase order.
I am getting the impression that EXISTS can only be used in a WHERE clause.
Is this correct? If so How can I accomplish this through a single query?
Thanks All,
Kevin
Here is the query
SELECT Inventory.Item, HasPurchOrder AS (Exists(SELECT PurchOrder.Order FROM PurchOrder WHERE PurchOrder.Item = '12345' AND PurchOrder.Status = 'OPEN')) FROM Inventory WHERE Inventory.Item = '12345'
I don't want a list of purchase orders I just want a list of
Inventory items and whether or not it has a purchase order.
I am getting the impression that EXISTS can only be used in a WHERE clause.
Is this correct? If so How can I accomplish this through a single query?
Thanks All,
Kevin