You are here: Re: Query question « MsSQL Server « IT news, forums, messages
Re: Query question

Posted by Erland Sommarskog on 10/10/36 11:33

Yannick Turgeon (vendredi5h@gmail.com) writes:
> Ok. Thanks to both of you.
>
> I think something like:
>
> SELECT a.data
> FROM #Test a
> WHERE a.type = 'A'
> GROUP BY a.type
> HAVING pid = MAX(pid)
>
> or even better:
>
> SELECT a.data
> FROM #Test a
> WHERE a.type = 'A'
> AND pid = MAX(pid)
>
> would be a good functionnality (with MAX or any other aggregate
> function) to add to transact/SQL or to SQL standard.

Maybe. If it clear what it means. Which in at least in the second
case is not at all clear. MAX(pid) in the entire #Test? MAX(pid) for
type = 'A' or what?


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

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

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