I got stuck in this one, and i belive there's a solution, i just don't
happen to see it.

i have a table with conections between itens. something like
+---+---+
| A | B |
+---+---+
| 1 | 2 |
| 1 | 3 |
| 1 | 4 |
| 2 | 1 |
+---+---+

i'm trying to solve with one query a way to get all of the relations
with 1 on the A colum but having another field, telling me if the
relation is mutual. something that would return
+---+--------+
| B | mutual |
+---+--------+
| 2 |    1    |
| 3 |    0    |
| 4 |    0    |
+---+--------+

Can you think of anything that doesn't involve some big temporary
tables or one extra query for every row found on the first one?

,
Gabriel

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

Reply via email to