Re: Selecting All Columns Associated With Maximum Value of One Column
От
Rich Shepard
Тема
Re: Selecting All Columns Associated With Maximum Value
of One Column
Дата
Msg-id
alpine.LNX.2.00.1110060702350.26051@salmo.appl-ecosys.com
Ответ на
Список
Дерево обсуждения
Selecting All Columns Associated With Maximum Value of One Column Rich Shepard <rshepard@appl-ecosys.com>
Re: Selecting All Columns Associated With Maximum Value of One Column David Johnston <polobo@yahoo.com>
Re: Selecting All Columns Associated With Maximum Value
of One Column Rich Shepard <rshepard@appl-ecosys.com>
Re: Selecting All Columns Associated With Maximum Value of One Column Thomas Kellerer <spam_eater@gmx.net>
Re: Selecting All Columns Associated With Maximum Value
of One Column Rich Shepard <rshepard@appl-ecosys.com>
Re: Selecting All Columns Associated With Maximum Value of One Column David Johnston <polobo@yahoo.com>
Re: Selecting All Columns Associated With Maximum Value
of One Column Rich Shepard <rshepard@appl-ecosys.com>
Re: Selecting All Columns Associated With Maximum Value
of One Column Gavin Flower <GavinFlower@archidevsys.co.nz>
Re: Selecting All Columns Associated With Maximum Value of
One Column Chris Curvey <chris@chriscurvey.com>
Re: Selecting All Columns Associated With Maximum Value
of One Column Rich Shepard <rshepard@appl-ecosys.com>
On Thu, 6 Oct 2011, David Johnston wrote: > Missing the FROM before chemistry D'oh! Obviously not yet sufficiently cafinated this morning. >> Also, with the window function can I limit the output to a single str_name >> and param? > > Not directly. After you create the windowed result you can turn it into a > sub-query and filter that. The other form suggested (where quant = select > max(quant) from chemistry where ...) is probably a better performer though > for your need - I did't read the subject line closely enough and my two > options don't directly give you what you are looking for. Though era ing > the window query and then adding a (where quant_max = quant) clause would > get you closer; quant_max being the column alias for the window > expression. Ah. Thanks, David, Rich
В списке pgsql-general по дате отправления
От: David Johnston
Дата:
От: Thomas Kellerer
Дата: