I have a UNION whose statements when interchanged gives a different result. I 
can understand the change in the order of the rows, but how is it that 
'picture' gets the correct value in (a) but not in (b)? Here are the two 
queries and their results:

(a)
  (SELECT u.lName last_name, u.picture FROM teamEntry te, user u WHERE 
te.person_id = u.uId AND te.tId IN (1) LIMIT 5) 
UNION
  (SELECT a.last_name, 0 picture FROM teamEntry te, author a WHERE te.person_id 
= a.person_id AND te.tId IN (1) LIMIT 5);

last_name                       picture
Kapoor                          avataar02.png <from table u>
Manni                           0             <from table u>
Office of Technology Assessment 0             <from table a>
Queue Readers                   0             <from table a>
Milnes                          0             <from table a>

(b)
  (SELECT a.last_name, 0 picture FROM teamEntry te, author a WHERE te.person_id 
= a.person_id AND te.tId IN (1) LIMIT 5)
UNION 
  (SELECT u.lName last_name, u.picture FROM teamEntry te, user u WHERE 
te.person_id = u.uId AND te.tId IN (1) LIMIT 5);

last_name                       picture
Office of Technology Assessment 0  <from table a>
Queue Readers                   0  <from table a>
Milnes                          0  <from table a>
Kapoor                          0  <from table u>
Manni                           0  <from table u>

Thanks for your help,
Nishi


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

Reply via email to