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

Posted by Jens on 11/03/05 14:28

--Create the other column

ALTER TABLE #tempone ADD SomeCalcValue REAL NULL

UPDATE #Tempone SET
col3 =
((SELECT TOP 1 SomeValue
FROM #Tempone T2
WHERE T1.SomeId = T2.SomeID
AND T2.SomeValue > T1.SomeValue
ORDER BY SomeValue )
/ (CASE SomeValue WHEN 0 THEN NULL ELSE SomeValue
END)-1)*100
>From #Tempone T1

But what I already mentioned and David mentioned is the sequence in
which the calculations is done in place, because in your sample data
there was no structure to find any logic of the sequence in there.

BTW, Call me Jens :-D

HTH, jens Suessmeyer.

 

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

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