查询null以及length(),trim()使用

select * from stu_course t

--  产品
select * from stu_course t 
where t.is_publish='Y' and t.pid is null 

--  模块
select t.*,length(trim(t.code)) lengthhh from stu_course t 
where t.is_publish='Y' and t.pid is not null and length(trim(t.code))>4


--    select * from   student s  where     s.sno= 183  order by   
      
      ---    nvl(length(trim(s.sname)),0) asc -- 递增排序  
      
    -- nvl(attribute,default value) 当属性值为空时就将其值设默认值  
      
    -- length(attrbute) 得到字符串的长度  
      
    -- trim(attribute) 去掉字符的空格  


你可能感兴趣的:(null,产品)