34,588
社区成员
发帖
与我相关
我的任务
分享
select top 1 null as col1 from tbl1 where 1=1
select null col
/*
col
-----------
NULL
(1 行受影响)
*/
select col = case when getdate() > getdate() - 1 then 'null' end
/*
col
----
null
(1 行受影响)
*/
declare @tb table (id int)
insert into @tb select 1
insert into @tb select 2
insert into @tb select 3
select top 1 id=null from @tb
/*
id
NULL
*/