create FUNCTION [dbo].[fun1]
(
@ID int
)
RETURNS TABLE
AS
RETURN
(
declare @var int
select @var =select columnName from dbo.fun2(@id)
SELECT @var* columnName from
table
where table.id=@ID
)
我该怎么做?
答案 0 :(得分:0)
SET @var = ( SELECT columnName
from dbo.fun2(@ID)
);
SELECT @var * columnName
from table
where table.id = @ID;