--函数可以调用函数不可以定义 --测试:Create Function F_A() returns varchar(2000) as begin return 'dddddddd' endCreate Function F_B() returns varchar(2000) as begin declare @t varchar(2000) select @t= dbo.F_A() return @t endselect dbo.F_B() --结果 dddddddd--删除环境 drop function F_A,F_B
select * from ( select top 5 ID from test order by ID DESC ) 大哥再帮忙看看这句话怎么有错
select * from ( select top 5 ID from test order by ID DESC ) A
select * from ( select top 5 ID from test order by ID DESC )=======================> 加表的别名:select * from ( select top 5 ID from test order by ID DESC )t
--测试:Create Function F_A()
returns varchar(2000)
as
begin
return 'dddddddd'
endCreate Function F_B()
returns varchar(2000)
as
begin
declare @t varchar(2000)
select @t= dbo.F_A()
return @t
endselect dbo.F_B()
--结果
dddddddd--删除环境
drop function F_A,F_B
select top 5 ID from test order by ID DESC ) 大哥再帮忙看看这句话怎么有错
select top 5 ID from test order by ID DESC ) A
select top 5 ID from test order by ID DESC )=======================>
加表的别名:select * from (
select top 5 ID from test order by ID DESC )t
DML和DDL不能混在一起用