sql中用LTRIM ( ),RTRIM ( )。分别截断首尾空格,返回字符表达式。

例1:

DECLARE @string_to_trim varchar(60)
SET @string_to_trim = '    Four spaces are after the period in this sentence.    '
SELECT 'BEGIN|' + CHAR(13) + ltrim(rtrim(@string_to_trim))+'|END'

詳見:http://blog.sina.com.cn/10l01

 

例2:@"Select ltrim(rtrim(ProbCd)) as ProbCd,ltrim(rtrim(Descript)) as Descript from bd_ProbCdwhere substring(ProbCd,1,2) = '" + strProbCls + "' order by ProbCd"

相关文章:

  • 2022-12-23
  • 2021-12-23
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2021-09-13
  • 2021-05-24
猜你喜欢
  • 2021-08-24
  • 2022-12-23
  • 2022-12-23
  • 2021-08-01
  • 2022-12-23
  • 2021-11-17
相关资源
相似解决方案