可以通过where条件语句实现。
sql:select
*
from
tablename
where
name
like
'张%'
and
id>5;
解释:以上就是通过条件查询出名字以张开始的,id大于5的表数据。
备注:多条件之间如果是同时满足用and,如果是满足其中一个用
or。
select * from clgl where 新闻标题<>'' order by id desc
select * from clgl where 新闻标题<>''and 新闻标题 is not null order by id desc
select * from clgl where 新闻标题<>NULL order by id desc
改成单引号
select * from clgl where 新闻标题<>'' order by id desc
或者
select * from clgl where 新闻标题<>NULL order by id desc
select * from clgl where 新闻标题 is not null
不要排序
如果要排序,另起一行写,不要写在一行上
select * from clgl where 新闻标题<>'' order by id desc
SQL server 建议用
select * from clgl where 新闻标题<>''
and 新闻标题 is not null
order by id desc