How to join results with UNION in MySQL?
Submitted by winter on Fri, 12/07/2007 - 08:04.
The UNIONs were introduced in MySQL 4. The unions are useful if you wish to join the results from more than one query, but be aware that the number of the returned columns by each select query should be the same.
(as well as their type)
The very simple example below show you the basics of the UNION statement
SELECT id, name FROM my_table
UNION
SELECT id, name FROM my_table;

Delicious
Digg
StumbleUpon
Propeller
Reddit
Magnoliacom
Newsvine
Furl
Facebook
Google
Yahoo
Technorati
Icerocket
Post new comment