Re: please give me select sqls examples to distinct these!

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: jacktby(at)gmail(dot)com, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: please give me select sqls examples to distinct these!
Date: 2022-10-25 18:10:38
Message-ID: b799b1bc-f428-3752-d75e-a0fcf36bade6@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/25/22 09:58, David G. Johnston wrote:
> On Tue, Oct 25, 2022 at 8:56 AM Rob Sargent <robjsargent(at)gmail(dot)com> wrote:
>
> On 10/25/22 09:24, David G. Johnston wrote:
>> On Tue, Oct 25, 2022 at 8:22 AM David G. Johnston
>> <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>>
>> On Tue, Oct 25, 2022 at 7:06 AM Rob Sargent
>> <robjsargent(at)gmail(dot)com> wrote:
>>
>>
>>
>> 2: select * from table join table b on Id = idb
>>
>>
>>
>> #2 is probably conceptually correct but in this context
>> should be written as:
>>
>>
>> Actually, a join is NOT conceptually correct here - the output
>> columns for "SELECT *" will be wrong.
>>
>> David J.
>>
> OK.  TBH I thought this was the JOOQ list! Didn't notice the
> typedef.  So this is all about exact match "tables".
>
> I suppose my #2 could be framed as
> select a* from table as a join table as b on a.<criteria> =
> b.<criteria>
> to be a functional equivalent of INTERSECT?
>
>
> SELECT DISTINCT a.*
>
> David J.
Yeah, sorry.  Meant to distinguish to two "table" defs in some way.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message j.emerlik 2022-10-25 21:19:49 Re: synchronous streaming replication
Previous Message David G. Johnston 2022-10-25 15:58:47 Re: please give me select sqls examples to distinct these!