List:General Discussion« Previous MessageNext Message »
From:Peter Brawley Date:April 21 2007 7:11pm
Subject:Re: What is the equivalent of the minus function?
View as plain text  
>select email from participants
>minus
>select email from excluded

Try an exclusion join (http://www.artfulsoftware.com, "The [Not] exists query pattern")
...

select email 
from participants p
left join excluded e on p.email=e.email
where e.email is null;

PB

-----

Brian Menke wrote:
> I am trying to do something like this
>
>  
>
> select email from participants
>
> minus
>
> select email from excluded
>
>  
>
> It seems there is no minus function in MySQL. I tried goofing around with
> intersects and union, but can't seem to make it work.
>
>  
>
> Is there a better way to achieve the same thing?
>
>  
>
> Thanks in advance for your help!
>
>  
>
> -Brian Menke
>
>
>   
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.463 / Virus Database: 269.5.7/771 - Release Date: 4/21/2007 11:56 AM
>   

Thread
What is the equivalent of the minus function?Brian Menke21 Apr
  • Re: What is the equivalent of the minus function?Peter Brawley21 Apr
  • Re: What is the equivalent of the minus function?Andrew Wallace23 Apr