首页 > 数据库技术 > 详细

三种数据库截取字段内容&&获取字符长度的函数如下

时间:2019-08-01 14:09:12      阅读:141      评论:0      收藏:0      [点我收藏+]
        if(databaseutil.getValue("database").equalsIgnoreCase("sqlserver")){
        	
       	 list =categoryFLDao.findBySQL("select id,substring(full_name,6,datalength(full_name)-6) from fhcb_08_tbl_category where full_id like ‘" + cid + "~%‘and id!="+cid  );
	
        }else if(databaseutil.getValue("database").equalsIgnoreCase("mysql")){
        	 list =categoryFLDao.findBySQL("select id,substring(full_name,6,CHAR_LENGTH(full_name)-6) from fhcb_08_tbl_category where full_id like ‘" + cid + "~%‘and id!="+cid  );
        }
        else if(databaseutil.getValue("database").equalsIgnoreCase("oracle")){
       	 list =categoryFLDao.findBySQL("select id,SUBSTR(full_name,6,LENGTH(full_name)-6) from fhcb_08_tbl_category where full_id like ‘" + cid + "~%‘and id!="+cid  );

        }

  

三种数据库截取字段内容&&获取字符长度的函数如下

原文:https://www.cnblogs.com/qinyios/p/11281739.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!