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

Posted by Hugo Kornelis on 11/23/05 01:25

On Tue, 22 Nov 2005 20:02:03 GMT, Will Chamberlain wrote:

(snip)
>SELECT Max(COALESCE(Sheet.Ver, 'NONE')) AS MaxOfVer,
>Max(COALESCE(Update.Update, 0)) AS MaxOfUpdate, Sheet.SheetNumber FROM
(snip)

Hi Will,

Following on to Erlands remakrs, I think you should change this part to

SELECT COALESCE(MAX(Sheet.Ver), 'NONE') AS MaxOfVer,
COALESCE(MAX(Update.Update), 0) AS MaxOfUpdate,
Sheet.SheetNumber
FROM ....

That way, the MAX of all values will be used, or NONE / 0 if there were
no values at all in the set.

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)

 

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

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