I think you are after subselects more than a UNION. The latest example of me using union was where a had 2 queries with table A and B: first query has tableA LEFT JOIN tableb, second query had tableb LEFT JOIN tablea. By using UNION I was able to retrieve the results of both with one query.
Regards, Mike Hillyer www.vbmysql.com > -----Original Message----- > From: Daniel Rossi [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 25, 2003 9:15 PM > To: [EMAIL PROTECTED] > Subject: use of UNION > > > hi there , i finally worked out union joines are supported in > 4.0 i thought it was 4.1 , anyway what are possible examples > of its uses ? > > say i'm trying to join two tables the second table has 10 > rows returned with the key of the first table i would like to > only get one record from the first table is this possible in > the union statement ? currently i have to loop through the > first query statement then in that loop do another select > statement within the loop and loop through the second query > statement returning those ten rows, if i join them on the > same query i'll get multiple records of the first table > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/mysql?> [EMAIL PROTECTED] > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]