常用sql字符串函数.docVIP

  • 1
  • 0
  • 约4.67千字
  • 约 7页
  • 2016-04-13 发布于山西
  • 举报
常用sql字符串函数

常用SQL字符串函数 问: 请教一个SQL 2000 SEVER问题: select?*?from?itemcode where?code?like?’40%’? 如何让code 变成code=401-01-001 目前有666个CODE是类 用 什么语句能把它变成401-01-001?? 答: update?itemcode?set?code=replace(code,left(code,8),left(code,3)+’-’+substring(code,4,2)+’-’+substring(code,6,3))?where?code?like?’40%’ 问: replace(code,left(code,8),left(code,3)+’-’+substring(code,4,2)+’-’+substring(code,6,3)) 是什么意思?? 答: 拿?code=123456789?做例子 a?=?left(code,8)????????= b?=?left(code,3)????????=?123 c?=?substring(code,4,2)?=?45 d?=?substring(code,6,3)?=?678 e?=?b+’-’+c+’-’+e???????=?123-

文档评论(0)

1亿VIP精品文档

相关文档