Last I checked MySQL doesn't support MINUS, but it's been a few years
since I used it.  I vaguly remember talk about the developers planning on
adding it.  I took a quick glance at the docs, but I can't seem to find
anything one way or another.  Is it in one of the later versions of MySQL?


On Fri, 26 Jan 2007, Jeffrey Barnett wrote:

You have gotten a lot of suggestions, but here is one more.

select * from lib_books where good_thing = 'TRUE'
MINUS
select * from lib_books where bad_thing = 'TRUE'

I think MINUS is faster than JOIN.

Other SET OPERATIONS include UNION and INTERSECT.

Set operations require that the underlying result sets be "compatible":
Same number of columns.
Corresponding columns have matching datatypes.


Ken Irwin wrote:
Hi all,

Thanks for these myriad responses! I've gotten at least three distinct
approaches to try. I knew there had to be a better way.

your sql-fu is appreciated!

joys
Ken

Reply via email to