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
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
* Thomas Moore
> The issue has to do with relating a PRODUCT table and ATTRIBUTE table so
> that one product is related to multiple attributes. In the
> shopping cart, I
> want to show multiple select menus. After a user selects all of them, only
> the parts related to those attributes will be dis
10:43 AM
To: MySQL List
Cc: [EMAIL PROTECTED]
Subject: RE: alternative to intersect in mySQL
* Thomas Moore
> > I know that intersect does not work yet with mySQL. I am selecting data
> from
> > two tables. Results of one select
> > would be 1, 2, 3, 4 . Results of other
* Thomas Moore
> > I know that intersect does not work yet with mySQL. I am selecting data
> from
> > two tables. Results of one select
> > would be 1, 2, 3, 4 . Results of other select 1, 2.
>
> > Want to print 1, 2.
>
> > Are there any nice workarounds using PHP or SQL?
[temporary table]
> If
23, 2002 1:08 AM
To: Thomas Moore
Cc: MySQL List
Subject: Re: alternative to intersect in mySQL
Hi,
> I know that intersect does not work yet with mySQL. I am selecting data
from
> two tables. Results of one select
> would be 1, 2, 3, 4 . Results of other select 1, 2.
> Want t
Hi,
> I know that intersect does not work yet with mySQL. I am selecting data from
> two tables. Results of one select
> would be 1, 2, 3, 4 . Results of other select 1, 2.
> Want to print 1, 2.
> Are there any nice workarounds using PHP or SQL?
You could use a temporary table to store the
I know that intersect does not work yet with mySQL. I am selecting data from
two tables. Results of one select
would be 1, 2, 3, 4 . Results of other select 1, 2.
Want to print 1, 2.
Are there any nice workarounds using PHP or SQL?
thanks,
-tom
---
11 matches
Mail list logo