473,706 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Alternate for INTERSECT in mysql 4.1.15

3 New Member
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 3497
pbmods
5,821 Recognized Expert Expert
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 New Member
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 New Member
----------

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

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

Similar topics

6
39945
by: Nick | last post by:
I have three tables books (id, title, author) authors (id, name) authors_groups (author_id, group_id) I have a query that searches for authors who must be in a least one subgroup of two groups. I hope that makes sense. Here are some examples im working on...
1
714
by: sunaina | last post by:
I am doing the following query using intersect but gives me an error 'error in sql syntax. I tried using join as well but gives me similar error. In the following code still has intersect just to show exactly what I want to do. My query in mysql console is working without using intersect or join. $query_objects = ""; for ($i=0; $i<$num_questions; $i++) { if ($i != 0)
1
2444
by: Brian | last post by:
Greetings all, I wrote a message regarding hit-lines here a couple of days back saying: "Anyone got links to some examples of using Region and/or Region.Intersect in a graphical / gaming enviroment? Am investigating into using it for hit-lines in my game."
2
4939
by: ngenius | last post by:
Hello everyone, I am new to MySQL but just realized it does not support INTERSECT in MySQL 5.0 Community Server. I have this problem to solve. (1) cust_table cust_id city_code. (2) agent_table agent_code cust_id
1
1502
by: Xpertboy | last post by:
i am trying to execute following code in asp var strSQL1="select Model from Phones where Brand='"+ brand +"'"; var strSQL2="select Model from Phones where Model='"+ model +"'"; var strSQL3="select Model from Phones where Camera='"+ camera +"'"; var strSQL=strSQL1+" intersect "+ strSQL2+" intersect "+strSQL3 conn.Execute(strSQL); but its giving error in executing query... basically i want intersect of 2 or more features using...
3
5605
by: prathamesh.deshpande | last post by:
Hi, I am facing problem while excuting a mysql query. My problem is as follows- I have two tables object_1 and object_2. The structure of object_1 is object_id name address ------------ ---------- ------------ 1 abc xyz 2 pqr xyz
0
1402
by: egur | last post by:
Hi, I'm looking for reliable MySQL version (for Windows) that supports "EXCEPT" and "INTERSECT" execution. Would somebody recommend such version (and corresponding client), please?
1
1702
by: kadhir34 | last post by:
Can any one give an alternative to this oracle query in mysql Select s.EMP_CODE,fname from profilesys.skill_emp_master P join profilesys.skill_master_new R on ( P.Skill_id = r.skill_id) join profilesys.employee_master s on(p.EMP_CODE = s.EMP_CODE) AND UPPER(coalesce(R.STATUS,'WORKING')) NOT IN ('RETIRED','RESIGNED','ABSCONDING') where (PROFICIENCY_LEVEL >= '"+skillLevel+"' and p.skill_id = '"+skill+"' and PROJECT_EXPERIENCE >=...
1
2678
by: b00010783 | last post by:
Hi all, I have the table below. +--------+---------+-------------+--------------------------------+-------+----+ | parent | country | city | hotel | stars | id | +--------+---------+-------------+--------------------------------+-------+----+
0
8781
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8696
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9285
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7906
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5938
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4448
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4709
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2500
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2094
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.