Re: Help to simplify sample query

From: Daniel Henrique Alves Lima <email_daniel_h(at)yahoo(dot)com(dot)br>
To: Tomasz Myrta <jasiek(at)klaster(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Help to simplify sample query
Date: 2004-03-09 12:51:33
Message-ID: 404DBDD5.6090107@yahoo.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Daniel Henrique Alves Lima 2004-03-09 13:14:44 Re: Help to simplify sample query
Previous Message BenLaKnet 2004-03-09 07:53:42 Re: designer tool connect to PostgreSQL