sql高手快来救命呀!

small 2001-03-28 11:38:00
1、如何删除SQL数据库中的空记录?
2、用什么条件可以找到字段为空的记录?
...全文
133 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
LI_xiufu 2001-04-02
  • 打赏
  • 举报
回复
to k2:
已经select出来了,难道换成delete(delete from)还要教吗?
Springer 2001-04-01
  • 打赏
  • 举报
回复
TO YangZi ,用ORACLE吧。
delete from TableName
where NVL(ColumnName,'') = '';
k2 2001-03-31
  • 打赏
  • 举报
回复
select只是抽取数据,并不能删除。

yangzi 2001-03-31
  • 打赏
  • 举报
回复
在sql server里 ''和null不等。所以你要分别处理。
我不知道你所说的空是前者还是后者。
BlueSQu 2001-03-31
  • 打赏
  • 举报
回复
select * from table where trim(name) is null
LI_xiufu 2001-03-28
  • 打赏
  • 举报
回复
还需考虑空格不定的情况
select * from tablename where convert(varchar,fieldname) in (null,'')
gxdq 2001-03-28
  • 打赏
  • 举报
回复

select * from tablename where fieldname in (null,'',' ')
renzhm 2001-03-28
  • 打赏
  • 举报
回复
1.
delete from table where name is null;//若name 为 '空'在数据库中<NULL>
delete from table where name='';//若name 为 '空格'
2.
select * from table where name is null 或
select * from table where name=null

windindance 2001-03-28
  • 打赏
  • 举报
回复
1:
delete table where name is null
2:
select * from table where name is null
skyyoung 2001-03-28
  • 打赏
  • 举报
回复
select * from table where name is null

34,576

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧