Re: Help to simplify sample query

From: Daniel Henrique Alves Lima <email_daniel_h(at)yahoo(dot)com(dot)br>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Help to simplify sample query
Date: 2004-03-09 13:14:44
Message-ID: 404DC344.4070209@yahoo.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)yahoo(dot)com(dot)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
>
>
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message terry 2004-03-09 13:37:48 Re: Trying to make efficient "all vendors who can provide all items"
Previous Message Daniel Henrique Alves Lima 2004-03-09 12:51:33 Re: Help to simplify sample query