1. 字符串函数应用

--从指定索引截取指定长度的字符串
SELECT substring('abcdefg',2,5) 
--获取字符串中指定字符的索引(从1开始)
select charindex(',','ab,cdefg')
--实际应用中的语句
select proId,color,substring(FacePath,0,charindex(',',FacePath)) as FacePath from proselect where id=1000000

2. 日期函数应用

--获取三个月前的时间
SELECT DATEADD(month, -3,getdate())

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2022-01-02
  • 2022-12-23
  • 2021-11-20
猜你喜欢
  • 2022-02-06
  • 2021-12-02
  • 2022-03-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
相关资源
相似解决方案