
1、创建测试表,
create table test_null(id varchar2(20),value varchar2(20))
2、插入测试数据;
insert into test_null values(1,'123')
insert into test_null values(2,'abc')
insert into test_null values(3,'')
insert into test_null values(4,'456')
3、查询表中全量数据;select t.*, rowid from test_null t
select t.*, rowid from test_null t where value is null
1、打开您 *** 作数据库的可视化工具(我现在用的是DbVisualizer)。
2、在sql窗口中编写查询语句,我之前遇到这个问题的时候,找了好久都是说使用value,nvl,decode等等函数去 *** 作,这样用法确实可以,但是不适用于我遇到的这个情况,那些方法只适用于存在此条记录,但是某一字段可能为null的情况。
3、在sql窗口中可使用迂回的方式进行查询设定默认值。可先查询是否含有此条记录存在,如果不存在就给查询的字段设定默认值,如果存在就使用子查询去取该字段真正的值。
连接数据库你应该会了吧我只些连接数据库中的表<% set rs=server.creatobject("adodb.recordset")sql="select * from news"rs.open sql,conn,1,2%><input type="button" name="text1" value="<% if rs("attachment")<>"" then%><%response.write("2")%><%else%><%response.write("1")%><%end if%>">欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)