以下是引用mywisdom88在2021-4-29 12:48:20的发言:
declare @a1 varchar(20),@a2 varchar(20)
set @a1 = 'F/G/R/E/T/E/S/T/'
set @a2 = '/T/S/E/T/R/G/F'
-- reverse()是把字符串倒置,reverse(a1)后,就是 a2
select substring(reverse(@a1),2,1)
declare @a1 varchar(20),@a2 varchar(20)
set @a1 = 'F/G/R/E/T/E/S/T/'
set @a2 = '/T/S/E/T/R/G/F'
-- reverse()是把字符串倒置,reverse(a1)后,就是 a2
select substring(reverse(@a1),2,1)
F、G、R、E等都是变量,不确定位数,不确定内容