For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > March 2005 > EXCEPT in MySQL









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author EXCEPT in MySQL
Kamil Zembrzuski

2005-03-17, 8:57 am

Hi.. I have 2 tables and I wanna get diffrences beetween them.. so in's
normal to use EXCEPT statement.. but MySQL doesn't recognize it..!! why??
Here is whole SQL statement:

beer liked by Sally but not Fred

SELECT beer
FROM likes
WHERE drinker='Sally'
EXCEPT
SELECT beer
FROM likes
WHERE drinker='Fred';

how can I translate in to work in MySQL?? please help.. :(

zoltek@sterydy.com.pl


J.O. Aho

2005-03-17, 8:57 am

Kamil Zembrzuski wrote:
> Hi.. I have 2 tables and I wanna get diffrences beetween them.. so in's
> normal to use EXCEPT statement.. but MySQL doesn't recognize it..!! why??


Could it be for it's not implemented to the MySQL, do suggest you at least use
MySQL 4.1, 5 is still under "alpha" phase.


> how can I translate in to work in MySQL?? please help.. :(


Take a look at the SELECT and UNION sections in the user manual, you may find
info that can be usefull for you. dev.mysql.com/doc/mysql/en/select.html



//Aho
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com