Reply to Re: select another column where max

Your name:

Reply:


Posted by MGFoster on 02/14/06 10:17

Aaron Lawrence wrote:
> Hello all.
>
> Is there a simpler way to write something like this:
>
> select column_a from table
> where column_b = ( select max( column_b ) from table )
>
> ie. find the row where column_b is at it's maximum and return another
> column's value?
>
> something like (hypothetically)
>
> select column_a from table
> where column_b is max
>
> Leaving aside the issue of whether max( column_b ) is unique ...

SELECT column_a, MAX(column_b)
FROM table_name
GROUP BY column_a

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация