一个关于SQL语句的基础问题求解? 如果我要寻找的记录,条件为一个字段名为空,但我用select * from table where filed=''。''中间没有空格,结果是什么记录都找不到。应如何解决啊? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 isnull或者什么判断空的函数 select * from table where len(trim(filed))=0 select * from table where filed=''SELECT * FROM TABLE WHERE FILED IS NULL OR FILED='' 我一般是把查询的条件单独生成.if strtemp="" thenstrQCond = ""else strQCond = "where field='" & strtemp & "'"end ifstrSql = "select * from table" & " " & strQCond要是有多个条件就一个个加,别嫌麻烦,这样对于错误处理和输入检查什么的要方便得多. SELECT *FROM tableWHERE (filed IS NULL) OR (filed= '') where is null or rtrim(ltrim(field)) = '' select * from table where filed is null or filed = '' select * from table where filed is null or filed = ''或select * from table where len(trim(filed))=0上面两种我已经做过实验都可以 能不能用macro自动发报表? 在IDE里如何后退 关于inet控件,有点问题请教 急问,关于自己写的控件问题 怎样用VB编程找出系统中串行口COMM的个数? 谁有Setup Factory 6的使用方法? 怎样使VB的窗体总在顶层显示! 哪位高手有做过VB与运动控制卡或轴控卡,请发几个例子!谢谢! 关于报考程序员? 求所有内存的函数的声明和用法!天!我只能给24分!保证再加分! 远程连接ACCESS,报错“\\210.78.80.88\c$\a.mdb 不是有效路径”。 我想问一个比较让我困惑的问题,希望见过次贴的人能帮我顶上去!我希望早日将此问题搞清楚!分嘛好说,能解我惑者我全分相送!
或者什么判断空的函数
if strtemp="" then
strQCond = ""
else
strQCond = "where field='" & strtemp & "'"
end ifstrSql = "select * from table" & " " & strQCond要是有多个条件就一个个加,别嫌麻烦,这样对于错误处理和输入检查什么的要方便得多.
FROM table
WHERE (filed IS NULL) OR
(filed= '')
select * from table where filed is null or filed = ''
或
select * from table where len(trim(filed))=0
上面两种我已经做过实验都可以