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]
|