sql语句怎么写?
------解决方案--------------------------------------------------------
try
SELECT * FROM TableName Where IsNull(RTRIM(字段), ' ') != ' '
------解决方案--------------------------------------------------------
select 字段 from 表 where 字段 is not null and ltrim(字段) <> ' '
------解决方案--------------------------------------------------------
select * from table1 where replace(isnull(field, ' '), ' ', ' ') <> ' '
------解决方案--------------------------------------------------------
直接用RTRIM去掉空格即可,不需要用replace做替換。
------解决方案--------------------------------------------------------
SELECT * FROM Table_Pqs Where IsNull(rtrim(字段), ' ') <> ' '
字段 is not null and ltrim(字段) <> ' ' 和上面一样,谈不上有什么好处。就是简单一些而已
------解决方案--------------------------------------------------------
如果鱼还可以看到这个结过的贴子,能否讲一下
IsNull(RTRIM(字段), ' ') != ' '
和
字段 is not null and ltrim(字段) < > ' '
有什么区别与好处?
我来讲下吧,其实两句的效果都一样,RTRIM()是去除自尾空格,isnull(字段,‘’)的意思就是如果字段是null则替换成‘’ 整句的意思就是把字段去除尾部空格,判断是否为null,是的话替换成‘’ 在判断和‘’是否相等
后一句的一是就是把判断null和‘’分开写了,ltrim()是去除首尾空格,整体来说效果是一样的
select * from (select ROW_NUMBER() over(order by id desc) as row,* from Article) twhere t.row between 3 and 33with temp...
ACCESS数据库delete from temp Alter TABLE temp Alter COLUMN ID COUNTER (1, ...
查询语句只要这样写,就可以随机取出记录了SQL="Select top 6 * from Dv_bbs1 where isbest = 1 and layer = 1 order by newID() desc"在AC...
select * FROM user where Date between #2014-7-27 0:0:0# and #2014-7-27 23:59:59#;Select * From user Where msg Like...
create table [notdown]([notdown] oleobject)insert into [notdown](notdown) values (0x3C25)...