Reply to Re: select minimum between two values

Your name:

Reply:


Posted by Bobbo on 07/27/06 15:21

Chris Cheney wrote:

> One way, but not necessarily the smartest way:
>
> select min(a) from (select myfunction() a union select 100 a) t

Another, equally not-necessarily-smartest way, is to write your own
function. In fact, I wrote one today to work out the greater of two
numbers:

CREATE FUNCTION [dbo].[fnMathMax] (@a int, @b int)
RETURNS int AS
BEGIN

DECLARE @ret int
SET @ret = @a
IF @b > @a SET @ret = @b

RETURN @ret

END

[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

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