Re: HELP, can't implement e filter

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: giuseppe(dot)derossi(at)email(dot)it
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: HELP, can't implement e filter
Date: 2007-08-20 14:14:45
Message-ID: dcc563d10708200714q5a2fd0efp58add1624ddf4f6b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On 8/19/07, giuseppe(dot)derossi(at)email(dot)it <giuseppe(dot)derossi(at)email(dot)it> wrote:
> Hi,
> I need to implement a filter in order to select from the first table the
> second one...
> it could be simple, but i'm wasting time. Please, is there anyone could help
> me?
> thanks in advance
> Giu
>
> c1 c2 c3 c4 c5
> 1)133659;1;"0039";"00121";7
> 2)133664;1;"0039";"00121";12
> 3)133664;2;"0039";"00121";12
> 4)133665;2;"0039";"00121";12
> 5)135460;1;"0039";"01152";
> 6)135460;2;"0039";"01152";
> 7)135471;1;"0050";"00153";4
> 8)135471;2;"0050";"00153";4
>
>
> 1)133659;1;"0039";"00121";7
> 3)133664;2;"0039";"00121";12
> 4)133665;2;"0039";"00121";12
> 6)135460;2;"0039";"01152";
> 8)135471;2;"0050";"00153";4

Do you want the things in table1 that are in table2, or the things in
table2 that are NOT in table2?

Things in table1 that are in table2:

select * from table1 join table2 on (table1.field1=table2.field1 and
table1.field2=table2.field2 and ....)

things in table1 that are not in table2:

select * from table1 left join table2 on (table1.field1=table2.field2
and table1.field2=table2.field2 and ...) where table1.field1 IS NULL
or table1.field2 IS NULL or ...

replace elipses with the rest of the fields.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message giuseppe.derossi 2007-08-20 14:57:58 Re: HELP, can't implement e filter
Previous Message Ben Kim 2007-08-20 14:07:46 Re: HELP, can't implement e filter