Re: Help to simplify sample query - Mailing list pgsql-sql

From Daniel Henrique Alves Lima
Subject Re: Help to simplify sample query
Date
Msg-id 404DBDD5.6090107@yahoo.com.br
Whole thread Raw
In response to Re: Help to simplify sample query  (Tomasz Myrta <jasiek@klaster.net>)
List pgsql-sql
Tomasz Myrta wrote:

>
> Can you try this query ? :
>
> select cd_area from area a1
>  join teacher_course c2 using (cd_course)
> where (cd_teacher,cd_course) in (select 1,2 union select 98,45 union 
> select 11,0);
   Tomasz, the "in" in the query above will work like an "or" 
((cd_teacher=1,cd_course=2) or (cd_teacher=98,cd_course=45) or 
(cd_teacher=11,cd_course=0)) but i need an "and" behaviour (because of 
this i was using some exists/ands)...

Thanks for your reply.




pgsql-sql by date:

Previous
From: BenLaKnet
Date:
Subject: Re: designer tool connect to PostgreSQL
Next
From: Daniel Henrique Alves Lima
Date:
Subject: Re: Help to simplify sample query