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: Tomasz Myrta <jasiek@klaster.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Help to simplify sample query
Date: Tue, 09 Mar 2004 09:51:33 -0300
Message-ID: <404DBDD5.6090107@yahoo.com.br> (raw)
In-Reply-To: <404D6334.4030501@klaster.net>
References: <404D5920.40104@yahoo.com.br>
	<404D6334.4030501@klaster.net>

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.





view thread (7+ messages)  latest in thread

Message-ID: <404DBDD5.6090107@yahoo.com.br>
Permalink:  ../404DBDD5.6090107@yahoo.com.br/
Also on:    postgresql.org/message-id/404DBDD5.6090107@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, jasiek@klaster.net
  Subject: Re: Help to simplify sample query
  In-Reply-To: <404DBDD5.6090107@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