34,590
社区成员
发帖
与我相关
我的任务
分享
if exists (select @static = sbbyjh_level from dbo.sbbyjh_message where sbm_id = @Sb_id)
declare @number int
SELECT @number
/*
NULL
*/
DECLARE @table TABLE(id int)
INSERT INTO @table
SELECT 4
DECLARE @i INT
SELECT @i=id from @table
SELECT @i --此时@i为4了
IF exists (select id from @table where id = 5)
SELECT '存在'
ELSE
SELECT '不存在'
--上面这样是可以的
--下面这样是不可以的
IF exists (select @i=id from @table where id = 5)
SELECT '存在'
ELSE
SELECT '不存在'
select @static = sbbyjh_level --这是赋值