Re: psql question

From: Scott Lamb <slamb(at)slamb(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: psql question
Date: 2002-11-15 17:34:41
Message-ID: 1037381683.2848.2.camel@apt.slamb.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 2002-11-08 at 18:10, Mark Tooker wrote:
> SQL> select empno from emp where ((firstname,lastname) IN
> 2 (('John','Doe'),('Joe','Blow')));
>
> EMPNO
> ----------
> 1234

Cool, I'll have to try that sometime. Didn't know you could make tuples
out of values like that.

> Can anyone tell me what syntax _will_ work in psql?

I think you need to use and/or to duplicate that.

select empno
from emp
where (firstname = 'John' and lastname = 'Doe')
or (firstname = 'Joe' and lastname = 'Blow');

Not as terse, but it works.

Scott

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Lamb 2002-11-15 17:39:53 Re: null value in queries to default in zero
Previous Message Stephan Szabo 2002-11-15 17:16:49 Re: trigger ON delete