pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Francesc Leveque <webmaster@loroadictos.com>
To: pgsql-sql@postgresql.org
Subject: Subselect returning 2 columns
Date: Thu, 06 May 2004 10:52:04 +0200
Message-ID: <4099FCB4.1090300@loroadictos.com> (raw)

Hello,

Is correct to do something like?:

SELECT row1,row2 FROM mytable
WHERE (row1,row3) IN
(SELECT row1 as p1,MAX(row3) as p2 FROM mytable
WHERE row3 <= current_date
GROUP BY row1)

I mean, I don't see documentation about subselects returning more than 
one column, but it seems to work...

Thanks,
Francesc.




view thread (2+ messages)  latest in thread

Message-ID: <4099FCB4.1090300@loroadictos.com>
Permalink:  ../4099FCB4.1090300@loroadictos.com/
Also on:    postgresql.org/message-id/4099FCB4.1090300@loroadictos.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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: webmaster@loroadictos.com
  Subject: Re: Subselect returning 2 columns
  In-Reply-To: <4099FCB4.1090300@loroadictos.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