Re: Selecting All Columns Associated With Maximum Value of One Column

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Selecting All Columns Associated With Maximum Value of One Column
Date: 2011-10-06 13:11:27
Message-ID: alpine.LNX.2.00.1110060610270.26051@salmo.appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 5 Oct 2011, Chris Curvey wrote:

> Based on your subject line, I'm guessing that you want something like this:
>
> select quant, param, site_id, sample_date, str_name from chemistry where
> param = 'TDS' and str_name = 'BurrowCrk' and quant = (select max(quant)
> from chemistry where param = 'TDS' and str_name = 'BurrowCrk')

Chris,

Thank you. I missed seeing the latter part.

This returns 0 rows, but it puts me on the right track.

Rich

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2011-10-06 13:13:52 Re: Selecting All Columns Associated With Maximum Value of One Column
Previous Message Robert Buckley 2011-10-06 12:56:44 Re: script not working in php