22,219
社区成员
发帖
与我相关
我的任务
分享
--try:
select top 1 * from news where isnull(npic,N'')<>N'' and type=1 and look=1 order by ndate desc
create table test(name varchar(10))
insert test select 'a' union all
select null union all
select 'b'
go
select * from test
name
----------
a
NULL
b
(所影响的行数为 3 行)
select * from test where name is not null;
name
----------
a
b
(所影响的行数为 2 行)
----try
select top 1 * from news where (npic is not null or rtrim(ltrim(npic))<>'') and
type=1 and look=1 order by ndate desc