You are here: Re: select another column where max « MsSQL Server « IT news, forums, messages
Re: select another column where max

Posted by kengillett on 02/14/06 11:57

Aaron Lawrence wrote:
> MGFoster wrote:
> > SELECT column_a, MAX(column_b)
> > FROM table_name
> > GROUP BY column_a
>
> Huh? Won't that show me the max of column_b for every value of column_a.
> I only want to see the ONE value of column_a where column_b is at max.

Is it this simple?

Select top 1 column_a from table order by column_b desc

hth

 

Navigation:

[Reply to this 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

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