can we use union and intersects like left join and right join in Mysql?
in which conditions this(union and intersects) should be used?
Currently UNION and LEFT|RIGHT OUTER JOIN are supported
syntax of union is
SELECT ... UNION [ALL | DISTINCT] SELECT ... [UNION [ALL | DISTINCT] SELECT ...]
example
(SELECT a FROM tbl_name WHERE a=10 AND B=1 ORDER BY a LIMIT 10) UNION (SELECT a FROM tbl_name WHERE a=11 AND B=2 ORDER BY a LIMIT 10) ORDER BY a;
This can b done only from mysql version 5.0.0 alpha