Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jcCQw-00045c-Mb for pgsql-general@arkaria.postgresql.org; Fri, 22 May 2020 18:30:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jcCQv-00085Z-KT for pgsql-general@arkaria.postgresql.org; Fri, 22 May 2020 18:30:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jcCQv-00085S-CD for pgsql-general@lists.postgresql.org; Fri, 22 May 2020 18:30:13 +0000 Received: from mailout.easymail.ca ([64.68.200.34]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jcCQs-00010o-5T for pgsql-general@postgresql.org; Fri, 22 May 2020 18:30:12 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 305EA22BFF for ; Fri, 22 May 2020 18:30:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at emo06-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo06-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f_SDovOkWTYL for ; Fri, 22 May 2020 18:30:06 +0000 (UTC) Received: from shr-macbook-pro.local (unknown [8.39.228.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id BF87C21C3E for ; Fri, 22 May 2020 18:30:03 +0000 (UTC) From: Scott Ribe Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: query, probably needs window functions Message-Id: <037A65BF-4CFE-4EC0-A037-173C9DDF2A9C@elevated-dev.com> Date: Fri, 22 May 2020 12:30:02 -0600 To: pgsql-general@postgresql.org X-Mailer: Apple Mail (2.3608.80.23.2.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk given, let's say:=20 create table person (id int not null, name varchar); create table phone (id int not null, person_id int not null, number = varchar); select person.*, phone.number from person join phone on (person.id =3D = phone.person_id) order by... How would you get results where only the first row for a person was = filled in, with rest of that person's phones showing blanks for those = columns? I'm guessing that window functions provide this capability, but = I don't know how. -- Scott Ribe scott_ribe@elevated-dev.com https://www.linkedin.com/in/scottribe/