Re: How can I produce the following desired result?

From: greg(at)turnstep(dot)com
To: pgsql-sql(at)postgresql(dot)org
Cc: aicean(at)netspeed-tech(dot)com
Subject: Re: How can I produce the following desired result?
Date: 2003-10-15 14:48:37
Message-ID: e4ac6a52d3f01e6dfe0a2d31c2f5b5b5@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> How can I produce the following desired result?

SELECT * FROM mytable
JOIN
(SELECT goodid, MAX(storehistoryid) AS storehistoryid FROM mytable GROUP by 1) AS a
USING (goodid,storehistoryid);

- --
Greg Sabino Mullane greg(at)turnstep(dot)com
PGP Key: 0x14964AC8 200310151046

-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html

iD8DBQE/jV4PvJuQZxSWSsgRAmYlAJwL06D+VNkmAT7RDcjXPgGu9oPXkgCgx1SJ
OASzEJlWv6qi05xXhPH1NBY=
=szda
-----END PGP SIGNATURE-----

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jean-Luc Lachance 2003-10-15 15:36:13 Re: How can I produce the following desired result?
Previous Message robert 2003-10-15 14:12:44 Re: Escaping the $1 parameter in stored procedures