Re: [GENERAL] Retrieving multiple columns from a subquery

2012-05-14 Thread Chris Hanks
On Mon, May 14, 2012 at 8:36 PM, Tom Lane wrote: > Chris Hanks writes: > > Nothing? Are subqueries just not meant to be used this way? > > The SQL standard says not ;-). > > You could approximate it like this: > >select ..., (select row(x,y,z) from ...), ... from ...; > > as long as you

Re: [GENERAL] Retrieving multiple columns from a subquery

2012-05-14 Thread Tom Lane
Chris Hanks writes: > Nothing? Are subqueries just not meant to be used this way? The SQL standard says not ;-). You could approximate it like this: select ..., (select row(x,y,z) from ...), ... from ...; as long as you don't mind pulling the composite-value output syntax apart. This

Re: [GENERAL] Retrieving multiple columns from a subquery

2012-05-14 Thread Merlin Moncure
On Wed, May 9, 2012 at 11:42 AM, Chris Hanks wrote: > Hello - > > I have two tables: > > CREATE TABLE users > ( >   id serial NOT NULL, >   created_at timestamp with time zone NOT NULL, >   last_seen_at timestamp with time zone NOT NULL, >   -- some other columns... > ) > > CREATE TABLE emails > (

Re: [GENERAL] Retrieving multiple columns from a subquery

2012-05-14 Thread Chris Hanks
Nothing? Are subqueries just not meant to be used this way? On Wed, May 9, 2012 at 9:42 AM, Chris Hanks wrote: > Hello - > > I have two tables: > > CREATE TABLE users > ( > id serial NOT NULL, > created_at timestamp with time zone NOT NULL, > last_seen_at timestamp with time zone NOT NULL,