Hello Forum,
i have two tables orders and orders_pos
orders is for the head of an order and orders_pos for the articles in the order and now i need a query that bring me
all orders except those who have a state_ID = 7 in orders_pos. I wonder how is this posible with one query?
state_ID has a range from 0-10 so I can't write where MAX(state_id) <> 7
Can anyone help?
Greetings from Germany
Michael Temeschinko
i have two tables orders and orders_pos
orders is for the head of an order and orders_pos for the articles in the order and now i need a query that bring me
all orders except those who have a state_ID = 7 in orders_pos. I wonder how is this posible with one query?
Code:
orders
------------------
ID customer_no
------------------
1 5
2 8
3 9
4 3
------------------
porders_pos
------------------------------------
orders_id art_no state_ID
------------------------------------
1 78994 2
1 89984 2
1 9045 2
2 8945 2
2 8978 2
4 89789 2
4 9897 7
4 45345 2
------------------------------------
So order 4 shouldn't be in the resultset
Result:
------------------
ID customer_no
------------------
1 5
2 8
-------------------
state_ID has a range from 0-10 so I can't write where MAX(state_id) <> 7
Can anyone help?
Greetings from Germany
Michael Temeschinko