Please help,
below is my problem. Let's say I have 2 tables, a Products table and a
Colors table that go as follow:
Table Products
prodID Name
1 shirt
2 tshirt
3 pants
4 jeans
and
Table Colors
prodID Colors
1 Blue
1 Red
2 Blue
3 Black
3 White
4 Blue
I want to find out all the products that come in Blue, and if not I
want to have the color empty. The result I want from my Query / SQL
Statement is:
prodID Colors Name...
1 Blue
2 Blue
3
4 Blue
What should my SQL statement/Query be like?
I tried:
Select Product.ProdID, Colors.Colors
From
Products
Left Join Colors
on Product.ProdID = Colors.ProdID
where Colors.Colors = "blue"
and this is what I get:
prodID Colors
1 Blue
2 Blue
4 Blue
Notice that prodID 2 doesn't show up but I want to return all prodIDs
whether or not they have a color Blue.
Please help...
Thanks