zoukankan      html  css  js  c++  java
  • (转)Oracle中判断某字段不为空及为空的SQL语句

    比如

    insert into table a (a1,b1)values("a1",'');

    对于这种情况,因为表里存的是'',其实是没有内容的,要查询这个字段,不能直接使用

    select *
    from a
    where b1='';

    select *
    from a
    where b1 <> null;
    sql中判断非空不能用等号,因为null在sql中被看作特殊符号,必须使用关键字 is和not
    应该如此使用:
    select * from A where b1 is null -- 为空
    或者:
    select * from A where b1 is not null -- 不为空 
  • 相关阅读:
    hibernate入门
    struts文件上传
    Struts的增删改查
    struts入门
    Maven配置以及环境搭配
    layui增删改查
    easyui三
    A
    C. Permutation Cycle
    E
  • 原文地址:https://www.cnblogs.com/suxiaBlogs/p/7155569.html
Copyright © 2011-2022 走看看