On Wed, 3 Nov 2004, Chaitra Yale wrote:
> ...how can union be the same as intersect..iam trying to get the names
> of comapnies that are in both queries.for example the first query
> gives me companies A, B AND C and the second query gives A , B..i want
> the intersect of these 2 queriesso
Wouldn't
SELECT p.csymbol
FROM tblavgPrice p JOIN tblAssets a ON p.csymbol = a.csymbol
WHERE p.avg > 1 AND p.avg < 10
AND a.assets > 100 AND a.assets < 500
do what you want?
Michael
Chaitra Yale wrote:
...how can union be the same as intersect..iam trying to get the names
of comapnies that
...how can union be the same as intersect..iam trying to get the names
of comapnies that are in both queries.for example the first query
gives me companies A, B AND C and the second query gives A , B..i want
the intersect of these 2 queriesso i get companies A and B...if i
did a union i wil
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