Jump to content

Not allowed to use UNION


sKunKbad

Recommended Posts

I'd like to be able to check a product_categories table and a products table for sub-categories and products of a category, and while my query is working, I'm not allowed to use UNION because supposedly we may have problems if we go with something other than MySQL. (not that we would, but that's the theory)

 

SELECT category_id
FROM `product_categories`
WHERE parent_id =2
UNION SELECT product_id
FROM `products`
WHERE category_id =2

 

My options are: left, right, outer, inner, left outer, and right outer. I'm not a MySQL superstar, so if anyone can suggest a simple query that doesn't use UNION I would appreciate it.

 

Link to comment
https://forums.phpfreaks.com/topic/200601-not-allowed-to-use-union/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.