In the last episode (Aug 29), suresh said: > I dont really get your point Another thing I would like to highlight > I thought UNION will be used to join to SQL Queries and will display > only distinct values unless UNION ALL is used > > I don't know why the result is wierd or I do some misunderstanding > about UNION Here are the results of the query and UNION gives a > result that is very ubnormal > > Can anyone please explain why > > mysql> SELECT a.order_id, a.order_name FROM orderdetails AS a WHERE a.order_id = >'001'; > +----------+-------------+ > | order_id | order_name | > +----------+-------------+ > | 001 | palanichamy | > +----------+-------------+ > 1 row in set (0.00 sec) > > mysql> SELECT c.order_id, c.nature FROM complaints AS c WHERE c.order_id = '001' ; > +----------+-----------------------+ > | order_id | nature | > +----------+-----------------------+ > | 001 | I cant read man | > | 001 | I cant install either | > +----------+-----------------------+ > 2 rows in set (0.00 sec) > > When union is used it gives the result > mysql> SELECT a.order_id, a.order_name FROM orderdetails AS a WHERE a.order_id = >'001' > UNION ALL > SELECT c.order_id, c.nature FROM complaints AS c WHERE c.order_id = '001' ; > +----------+----------------------+ > | order_id | order_name | > +----------+----------------------+ > | 001 | palanichamy | > | 001 | I cant read man | > | 001 | I cant install eithe | > +----------+----------------------+ > 3 rows in set (0.00 sec)
Apart from the missing 'r' in the last record, I don't see anything unusual. If that's what you're talking about, file a bug report with mysqlbug. -- Dan Nelson [EMAIL PROTECTED] --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php