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

Posted by David Portas on 09/29/05 21:01

> create table a
> (account int
> ,balance_date datetime
> ,balance money)


Why are all your columns nullable? What is/are the key/s of this table?
Are you aware that MONEY will give you imprecisely rounded results when
you multiply or divide?

Try:

SELECT account, balance_date, balance
FROM a AS T
WHERE balance_date =
(SELECT MAX(balance_date)
FROM a
WHERE account = T.account) ;

--
David Portas
SQL Server MVP
--

 

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

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