I believe you're describing a crosstab query. This should help you put it 
together:

http://rpbouman.blogspot.com/2005/10/creating-crosstabs-in-mysql.html

---Michael

On Friday, July 09, 2010 07:37:41 pm Phillip Baker wrote:
> Hello All,
> 
> 
> For the life of me I cannot remember how to make a query like this and what
> it is called.
> I know it is fairly basic though.
> 
> 
> Table 1
> Product_id Product_Name
> 
> Table 2
> Category_id, Category_name
> 
> Table 3
> Product_id, Category_id
> 
> Each product can have one or more categories.
> So I want a result that has
> 
> Product A one category other category
> Product B other category
> 
> Thanks in advance.
> 
> Blessed Be
> 
> Phillip
> 
> If you try to protect idiots from themselves, even if you succeed, you just
> wind up filling the world with idiots.
>    - - Doug Casey

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to