Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 out of stock

Author  Topic 

sambrown180
Starting Member

38 Posts

Posted - 2008-12-09 : 12:56:34
for this query i need to use two tables

order and a product table

in my order table i have

Order_No (int), Customer_ID (int), and Product_price (vchar),

and in the product table i have availability (vchar)

now can anyone please tell me the query i need to show the customers who have made an order but the product is out of stock

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-09 : 13:05:29
[code]SELECT o.Customer_ID
FROM Order o
JOIN Product p
ON p.Product_ID=o.Product_ID
WHERE p.availability='False'
[/code]
Go to Top of Page

sambrown180
Starting Member

38 Posts

Posted - 2008-12-09 : 13:14:03
i also want it to show the Product_size prodct_colour product_price and the product_id how would i do this
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-09 : 13:20:29
quote:
Originally posted by sambrown180

i also want it to show the Product_size prodct_colour product_price and the product_id how would i do this


see now...this is what i told you before also. why cant you post the expected output in beginning itself. did you had time to look at link i posted yet?

SELECT *
FROM Order o
JOIN Product p
ON p.Product_ID=o.Product_ID
WHERE p.availability='False'


replace * with columns you want
Go to Top of Page
   

- Advertisement -