pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: jacktby@gmail.com, pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: please give me select sqls examples to distinct these!
Date: Tue, 25 Oct 2022 12:10:38 -0600
Message-ID: <b799b1bc-f428-3752-d75e-a0fcf36bade6@gmail.com> (raw)
In-Reply-To: <CAKFQuwauCTd7BzKnC6wDMpd+-OUOmVP4QPCcjzz3nFrsGXw6GA@mail.gmail.com>
References: <202210252154573516405@gmail.com>
	<8E137936-5D93-49FF-93A3-EB4E97D3416C@gmail.com>
	<CAKFQuwYvNChGg0-b+9siK0rNGj8Da-RAj3g9iy2kW=-rY1Uu8A@mail.gmail.com>
	<CAKFQuwb-20mcoHmea_m_+u__dwDY3qhv1TTnR9TRSfhPnVokDw@mail.gmail.com>
	<9743c2b4-86b9-944d-ca48-6fa73439d70b@gmail.com>
	<CAKFQuwauCTd7BzKnC6wDMpd+-OUOmVP4QPCcjzz3nFrsGXw6GA@mail.gmail.com>

On 10/25/22 09:58, David G. Johnston wrote:
> On Tue, Oct 25, 2022 at 8:56 AM Rob Sargent <robjsargent@gmail.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.g.johnston@gmail.com> wrote:
>>
>>         On Tue, Oct 25, 2022 at 7:06 AM Rob Sargent
>>         <robjsargent@gmail.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.

view thread (8+ messages)

Message-ID: <b799b1bc-f428-3752-d75e-a0fcf36bade6@gmail.com>
Permalink:  ../b799b1bc-f428-3752-d75e-a0fcf36bade6@gmail.com/
Also on:    postgresql.org/message-id/b799b1bc-f428-3752-d75e-a0fcf36bade6@gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: robjsargent@gmail.com, david.g.johnston@gmail.com
  Subject: Re: please give me select sqls examples to distinct these!
  In-Reply-To: <b799b1bc-f428-3752-d75e-a0fcf36bade6@gmail.com>
  References: <202210252154573516405@gmail.com> <8E137936-5D93-49FF-93A3-EB4E97D3416C@gmail.com> <CAKFQuwYvNChGg0-b+9siK0rNGj8Da-RAj3g9iy2kW=-rY1Uu8A@mail.gmail.com> <CAKFQuwb-20mcoHmea_m_+u__dwDY3qhv1TTnR9TRSfhPnVokDw@mail.gmail.com> <9743c2b4-86b9-944d-ca48-6fa73439d70b@gmail.com> <CAKFQuwauCTd7BzKnC6wDMpd+-OUOmVP4QPCcjzz3nFrsGXw6GA@mail.gmail.com> <b799b1bc-f428-3752-d75e-a0fcf36bade6@gmail.com>

* 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