Suppose I have two tables like this:

keystone_stores                managers
========================      
=================================================
 id | store_name                id | manager_name      | manager_type |
store_id
----+-------------------      
----+-------------------+--------------+---------
 AA | Wilshire's Oakland         1 | Fred Williams     | 1            | AA
 FR | Wilshire's Redmond         2 | Janice Plain      | 2            | AA
 LI | Dan's Food & Drug          3 | Janet Gilmore     | 1            | FR
                                 4 | Nick Woolstune    | 2            | FR
                                 5 | Ken Jennings      | 1            | LI
                                 6 | Fred Muelmann     | 2            | LI

Given that there will be exactly one of each of the two types of managers
per
store, is there a way to write a query that will generate the following
result
set?

store_name         | type_1_manager | type_2_manager
-------------------+----------------+---------------
Wilshire's Oakland | Fred Williams  | Janice Plain
Wilshire's Redmond | Janet Gilmore  | Nick Woolstune
Dan's Food & Drug  | Ken Jennings   | Fred Muelmann

Can this be done in a single query?

Greg

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to