Welcome Guest, Not a member yet? Register   Sign In
JOIN problem
#5

[eluser]wowdezign[/eluser]
After re-reading your post:
Code:
SELECT `orders`.`id`, `orders`.`order_date`, `orders_items`.`order_id`, `orders_items`.`product_id`
FROM (`order_items`)
JOIN `orders` ON `orders_items`.`order_id` = `orders`.`id`
WHERE `orders`.`customer_id` = '19'

That should give you a result set containing the items. It will have repeated order.ids but it gives you the order_items grouped like you said, if I understood you right.


Messages In This Thread
JOIN problem - by El Forum - 01-07-2010, 03:12 PM
JOIN problem - by El Forum - 01-07-2010, 03:55 PM
JOIN problem - by El Forum - 01-07-2010, 04:00 PM
JOIN problem - by El Forum - 01-07-2010, 04:03 PM
JOIN problem - by El Forum - 01-07-2010, 04:07 PM
JOIN problem - by El Forum - 01-07-2010, 08:22 PM
JOIN problem - by El Forum - 01-07-2010, 09:29 PM
JOIN problem - by El Forum - 01-07-2010, 10:39 PM
JOIN problem - by El Forum - 01-08-2010, 07:52 AM
JOIN problem - by El Forum - 01-09-2010, 12:18 AM
JOIN problem - by El Forum - 01-09-2010, 01:55 PM
JOIN problem - by El Forum - 01-09-2010, 02:18 PM
JOIN problem - by El Forum - 01-10-2010, 10:34 AM
JOIN problem - by El Forum - 01-10-2010, 10:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB