tags:

views:

104

answers:

3
+2  A: 

That should do it!

SELECT
*.orders
FROM orders INNER JOIN products
ON orders.product_id = products.product_id
WHERE products.manufacturers_id =1
ORDER BY orders_id
Marcos Placona
I totally do not see where you get the "AND products.manufacturers_id = 38 " from
Mark Schultheiss
LOL, the user updated it. It used to be 38 just a few minutes ago. I just updated mine accordingly, as it looked wrong now :-)
Marcos Placona
Great, I use the EDIT: form when I update my question, makes this kind of thing more reasonable.
Mark Schultheiss
I added some information to my post. I think this is the right way but to slow and i don't know why :-/
SurfingCat
+1  A: 

The simple way would be:

SELECT * FROM Orders WHERE product_id = 1
klausbyskov
+1: For the given query statement, the join is unnecessary. Obviously, if the output needed the manufacturer or something, then the join would be needed - but not as stated.
Jonathan Leffler
I need all products and order id where products.manufacturers_id = 1
SurfingCat
@SurfingCat, ok, but that is not what your original question said ;-)
klausbyskov
i updated my posting
SurfingCat
A: 

WHERE products.manufacturers_id = 1 AND products.product_id = orders.product_id

That's if you want to join the two tables. And besides that you request a product_od instead of a product_id

Machiel
od and id is now fixed... typing error in the post
SurfingCat