Re: INTERSECT in mysql

2004-11-03 Thread Tobias Asplund
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

Re: INTERSECT in mysql

2004-11-03 Thread Michael Stassen
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

Re: INTERSECT in mysql

2004-11-03 Thread Chaitra Yale
...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

Re: INTERSECT in mysql

2004-11-03 Thread SGreen
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

INTERSECT in mysql

2004-11-02 Thread Chaitra Yale
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

RE: alternative to intersect in mySQL

2002-04-23 Thread Roger Baklund
* 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

RE: alternative to intersect in mySQL

2002-04-23 Thread Thomas Moore
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

RE: alternative to intersect in mySQL

2002-04-23 Thread Roger Baklund
* 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

RE: alternative to intersect in mySQL

2002-04-23 Thread Thomas Moore
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

Re: alternative to intersect in mySQL

2002-04-23 Thread Aleksandar Bradaric
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

alternative to intersect in mySQL

2002-04-22 Thread 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? thanks, -tom ---