`
lushuaiyin
  • 浏览: 677277 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

查询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&&args.length>0){ for(int i = 0;i<args.length;i++){ pstmt.setObject(i+1, args[i]); } } rs = pstmt.executeQuery(); while(rs.next()){ User user = new User(); user....

    自动投票(C#源码).rar

    public CookieCollection cookie; public SRWebClient() { ... Cookie ck = GetCookieFromString(ary[i].Trim(), defaultDomain); if (ck != null) { cookieCol.Add(ck); } } } #endregion

    bytea类型上传下载图片.txt

    String filename=file_i.getName().trim(); //根据后缀判断 String xjh=""; for(int j=0;j<filename.length();j++){ if(filename.charAt(j)>=48 && filename.charAt(j)){ xjh+=filename....

    Oracle_Database_11g完全参考手册.part3/3

    《Oracle Database 11g完全参考手册》全面详细地介绍了Oracle Database 11g的强大功能,阐述了如何使用所有的新增功能和工具,如何执行功能强大的SOL查询,如何编写PL/SQL和SQL*Plus语句,如何使用大对象和对象,...

    Oracle_Database_11g完全参考手册.part2/3

    《Oracle Database 11g完全参考手册》全面详细地介绍了Oracle Database 11g的强大功能,阐述了如何使用所有的新增功能和工具,如何执行功能强大的SOL查询,如何编写PL/SQL和SQL*Plus语句,如何使用大对象和对象,...

    Excel POI读取封装(文件+示范代码)

    i < ch.length; i++) { ret *= 26; ret += this.ch2int(ch[i]); } return ret; } static final Config config = new Config(); /** 关闭数据库连接 */ public void closeResource(ResultSet rs, ...

    String工具箱

    if(s.trim().length()==0)return true; //trim() 方法为去掉空格及各种空字符 return false; } /**将一个字符串转换为整数*/ public static int toInt(String s){ if(isEmpty(s)) return -1; return Long...

    java在cpu的占有率

    if (line == null || line.length() ) { return null; } int capidx = line.indexOf("Caption"); int cmdidx = line.indexOf("CommandLine"); int rocidx = line.indexOf("ReadOperationCount");...

    java 数据库 课程设计 图书馆管理信息系统

    if(descri.trim().equals(null)){ //do nothing } else{ count++; descri=descri+"罚款一元"; interFace.edit("insert into dirty_info values('"+ count+"','"+s+"','"+descri+"') "); ...

    MD5SIGN.java

    if ("".equals(ciphertext) || null == ciphertext || "".equals(ciphertext.trim())) { return null; } char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F...

    带注释的Bootstrap.java

    (0, repository.length() - "*.jar".length()); repositories.add( new Repository(repository, RepositoryType.GLOB)); } else if (repository.endsWith(".jar")) { repositories.add( new Repository...

    C# 利用內建api產生驗證碼 (片段程式碼)

    if (checkCode == null || checkCode.Trim() == string.Empty) return; Bitmap image = new Bitmap((int)Math.Ceiling((checkCode.Length * 9.5)), 22); Graphics g = Graphics.FromImage(image); //產生隨機產...

    基于JAVA的航空售票系统

    this.flightNumber = flightField.getText().trim(); if (flightNumber.length() == 0) //未输入信息 { JOptionPane.showMessageDialog(null,"请输入航班号或者从列表中选择", "错误信息",JOptionPane.ERROR_...

    java发送短信之AT指令

    atCommand = StringUtil.encodeHex(commonsms.getSmstext().trim()) + String.valueOf(symbol3) + String.valueOf(symbol1); strReturn = myport.sendAT(atCommand); if (strReturn.indexOf("OK") != -1 && ...

    java课程设计(通讯录管理系统).doc

    } else if(password == null "" password.trim().length() == 0) { result.put("success", false); result.put("msg", "login.password.empty"); } else { LoginService ls = new LoginService(); list = ls....

    hibernate sprint 封装应用

    if (curpage == null || curpage.trim().length() == 0) curpage = "1"; int cpage = Integer.parseInt(curpage); // 过滤条件赋值 List fls = new ArrayList(); fls.add(new QCls("XM", QCls._STRING_, QCls._F_...

    LINQ_to_SQL语法及实例大全

    11.String.Trim() 54 12.String.Insert(pos, str) 54 13.String.Remove(start) 55 14.String.Remove(start, length) 55 15.String.Replace(find, replace) 55 LINQ to SQL语句(16)之对象标识 56 对象标识 56 对象...

    开发多媒体播放器

    if (rootPath.equals(pathEditText.getText().toString().trim())) { return super.onKeyDown(keyCode, event); } else { getFileDir(file.getParent()); return true; } //如果不是back键...

    VBScript函数查询

    日期或字符串的表达式 ) IsEmpty ( 变数 ) IsNull ( 变数 ) IsNumeric ( 表达式 ) LCase ( 字符串表达式 ) top Left( 字符串表达式 ,length) Len( 字符串表达式 变量 ) VBScript常用函数汇总:...

    2009达内SQL学习笔记

    通配符在搜索模式中任意位置使用,并且可以使用多个通配符。 通配符%表示任何字符出现任意次数;还能代表搜索模式中给定位置的0个或多个字符。下划线匹配单个任意字符。 如:select table_name from user_tables ...

Global site tag (gtag.js) - Google Analytics