Bug #31336 provide intersect and except, not only union
Submitted: 2 Oct 2007 10:29 Modified: 3 Oct 2007 12:03
Reporter: Maciej Pilichowski Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S4 (Feature request)
Version:5.0.45 OS:Linux
Assigned to: CPU Architecture:Any
Triage: Needs Triage: D5 (Feature request)

[2 Oct 2007 10:29] Maciej Pilichowski
Description:
I hope this wish is self explanatory.

However reason: mysql should be SQL compliant. I am also a teacher, so in a way I do free marketing for mysql. But the effect is poor because I have to disgress every second lesson and say "sorry, mysql does not support this and that". Now, it is not that hard to figure out the impression student can take from the whole semester about mysql, right?

How to repeat:
This is a wish, not a bug.

Suggested fix:
This is a wish, not a bug.
[3 Oct 2007 12:03] Valeriy Kravchuk
Thank you for a reasonable feature request.
[7 Apr 2009 15:53] luc hoegaerts
You are right, intersect and except are necessary features that the developers MUST implement again.

The reason the theoreticians of Mysql don't implement it,
is simple: the intersection and except statements are not elementary,
because they can be composed with other commands. 

Yes, from a theoretical perspective they are absolutely right.

But they forget the real world practicality of these commands.

In dynamic sql query building, one does not know in advance the names of tables, or column names (only their type), and one can intersect/difference the results only in a sequential manner. Intersect and except nicely fit this task.
Bypassing these commands makes writing dynamic SQL very very difficult.
(not impossible, but it requires suboptimal queries and more coding)

By the way, intersect and except are very easy to implment and run very fast.

Developers, please bring this issue to a higher level!

Remark it is not a 'wish', but it is a 'must have'.

best regards,
luc hoegaerts