Reply to Re: Can it be done ?

Your name:

Reply:


Posted by s on 03/30/06 08:56

On Tue, 28 Mar 2006 14:33:00 +0800, "McHenry" <mchenry@mchenry.com>
wrote:

>I have a table with 3 columns, propertyid, valuationdate & valuation
>
>I want to return the most recent valuation for each property, sounds simple
>but it's not !!

Not knowing what SQL engine you're using or how your table is defined,
try:

MySQL:

SELECT valuation FROM table WHERE propertyid = 123 ORDER BY
valuationdate DESC LIMIT 1

MSSQL et al:

SELECT TOP 1 valuation FROM table WHERE propertyid = 123 ORDER BY
valuationdate DESC

...hth

--
<s@guerril.la.ape> (to email, remove .ape)
--

[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

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