Re: Filter tables

From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: Reg Me Please <regmeplease(at)gmail(dot)com>
Subject: Re: Filter tables
Date: 2007-11-12 16:05:18
Message-ID: 200711121705.21642.dfontaine@hi-media.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Le lundi 12 novembre 2007, Reg Me Please a écrit :
> What I'd need to do is to "filter" t1 against f1 to get only the rows
> ( 'field1',1 ) and ( 'field2',1 ).

select * from t1 natural join f1 where t1.id = 1;
t | id
--------+----
field1 | 1
field2 | 1
(2 lignes)

I'm not sure about how you wanted to filter out the ('field1', 2) row of table
t1, so used the where t1.id = 1 restriction.

Hope this helps,
--
dim

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-11-12 16:05:34 Re: pg_tables and temp tables
Previous Message Gauthier, Dave 2007-11-12 15:54:53 reverse strpos?