码迷,mamicode.com
首页 > 数据库 > 详细

sql substring charindex

时间:2014-06-14 16:13:34      阅读:238      评论:0      收藏:0      [点我收藏+]

标签:style   string   art   cti   line   sql   

substring(s1,int,int) 截取字符串,起始位置,截取个数,返回截取后的字符串

charindex(s1,s2)查找字符s1在s2中的位置。返回int位置

 

SELECT substring(productid,0,(charindex(‘)‘,productid)+1)) as id1, substring(partid,0,(charindex(‘)‘,partid)+1)) as id2,* FROM IE_GYGJB_A where isnull(productid,‘‘) <> ‘‘ and substring(productid,0,(charindex(‘)‘,productid)+1)) <> substring(partid,0,(charindex(‘)‘,partid)+1))

sql substring charindex,布布扣,bubuko.com

sql substring charindex

标签:style   string   art   cti   line   sql   

原文地址:http://www.cnblogs.com/lhy5678888/p/3788060.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!