SQL有关的字符串拼接

1.字符串与某一查询栏位简单的拼接:

Select 'KS3F' || a.Line_Name as Line_Name
  From Sfis1.c_Line_Desc_t a
 Where a.Line_Name Like '3SMT%'
View Code

2.字符串与某一查询栏位的截取拼接:

Select 'KS3F' || substr(a.Line_Name, 2, 4) as Line_Name
  From Sfis1.c_Line_Desc_t a
 Where a.Line_Name Like '3SMT%'
View Code

3.字符串与某一查询栏位的截取去空拼接:

Select 'KS3F' || trim(substr(a.Line_Name, 2, 8)) as Line_Name
  From Sfis1.c_Line_Desc_t a
 Where a.Line_Name Like '3SMT%'
View Code

猜你喜欢

转载自www.cnblogs.com/wml-it/p/12744887.html