472,131 Members | 1,403 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,131 software developers and data experts.

Alternate for INTERSECT in mysql 4.1.15

3
hi ALL,
I have a situation to use INTERSECT in my query, but INTERSECT is not supported in "mysql 4.1.15".
Can anyone explain me how to tackle this problem..... !
Also, is there any version of mysql which allows the usage of INTERSECT ?


Thank you !

bzb...
May 31 '07 #1
3 3405
pbmods
5,821 Expert 4TB
Heya, bzb. Welcome to TSDN!

I have a situation to use INTERSECT in my query, but INTERSECT is not supported in "mysql 4.1.15".
Can anyone explain me how to tackle this problem..... !
The closest thing I could suggest would be to use a JOIN combined with SELECT DISTINCT.

Using the example on this page, I would probably do something along the lines of:

Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT `Store_Information`.`date` FROM `Store_Information`, `Internet_Sales` WHERE `Store_Information`.`date` = `Internet_Sales`.`date`;
  2.  
Or you could probably just do this:

Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT `date` FROM (`Store_Information` LEFT JOIN `Internet_Sales` USING(`date`));
  2.  
May 31 '07 #2
bzb
3
Heya, bzb. Welcome to TSDN!



The closest thing I could suggest would be to use a JOIN combined with SELECT DISTINCT.

Using the example on this page, I would probably do something along the lines of:

Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT `Store_Information`.`date` FROM `Store_Information`, `Internet_Sales` WHERE `Store_Information`.`date` = `Internet_Sales`.`date`;
  2.  
Or you could probably just do this:

Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT `date` FROM (`Store_Information` LEFT JOIN `Internet_Sales` USING(`date`));
  2.  
----------

hi pbmods,

Thank you - will try with this...

bzb...
May 31 '07 #3
bzb
3
----------

hi pbmods,

Thank you - will try with this...

bzb...
=#=#==#=#==#=#==#=#==#=#=

hi pbmods,

I solved the problem by using SELF JOIN and INNER JOIN in the same query.
Thanks.


bzb...
Jun 1 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Nick | last post: by
3 posts views Thread by prathamesh.deshpande | last post: by
1 post views Thread by kadhir34 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.