pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Henrique Alves Lima <email_daniel_h@yahoo.com.br>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: Help to simplify sample query
Date: Tue, 09 Mar 2004 10:14:44 -0300
Message-ID: <404DC344.4070209@yahoo.com.br> (raw)
In-Reply-To: <21339.1078813653@sss.pgh.pa.us>
References: <404D5920.40104@yahoo.com.br>
	<21339.1078813653@sss.pgh.pa.us>

    How about this:

select cd_area from area a1 where
   not exists ((select 1,2 union select 98,45 union select 11,0) except
   select c2.cd_teacher,c2.cd_course from teacher_course c2 where 
c2.cd_course=a1.course)

?

Tom Lane wrote:

>Daniel Henrique Alves Lima <email_daniel_h@yahoo.com.br> writes:
>  
>
>>    I don't think this is possible, but: Is there a efficient way to 
>>compare if the result of a query is a superset of the result of another ?
>>    
>>
>
>Perhaps do "SELECT foo EXCEPT SELECT bar" and see if you get anything?
>
>			regards, tom lane
>
>  
>





view thread (7+ messages)  latest in thread

Message-ID: <404DC344.4070209@yahoo.com.br>
Permalink:  ../404DC344.4070209@yahoo.com.br/
Also on:    postgresql.org/message-id/404DC344.4070209@yahoo.com.br

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: email_daniel_h@yahoo.com.br, tgl@sss.pgh.pa.us
  Subject: Re: Help to simplify sample query
  In-Reply-To: <404DC344.4070209@yahoo.com.br>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox