Assuming you have access to MySQL 4.0+

select csymbol from tblavgPrice where avg > 1 and avg < 10 
UNION
select csymbol from tblAssets where assets > 100 and assets < 500

Unless you say UNION ALL, you won't get duplicate values.
For more details: http://dev.mysql.com/doc/mysql/en/UNION.html

Just out of curiosity and because this is not the first time the INTERSECT 
question has come up. What SQL dialect are you coming from?

IF you are using a MySQL server that is pre-4.0+, you will have to recode 
that query using any of several variations that use a temporary table. Let 
me know if you need that work-around.

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine


Chaitra Yale <[EMAIL PROTECTED]> wrote on 11/03/2004 02:12:42 AM:

> hi
> 
> i have a problem mysql doesnt seem to support the intersect can
> somebody help how i can write the followoing code in mysql
> 
> select csymbol from tblavgPrice where avg > 1 and avg < 10 
> intersect
> select csymbol from tblAssets where assets > 100 and assets < 500
> 
> thanks
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
> 

Reply via email to