我无法理解为什么 RIGHT 功能对我不起作用。我试图在这里输入尽可能多的输出,如果阅读起来令人困惑,我深表歉意。
DECLARE @Nbr VARCHAR(27)
SELECT @Nbr = xmz.nbr
FROM @xml_temp AS xmz
SELECT @Nbr AS 'Number',
LEFT(@Nbr, 4) AS 'LEFT',
LEN(@Nbr) AS 'Length',
SUBSTRING(@Nbr, 10, 4) AS 'SUBSTRING',
RIGHT(@Nbr, 4) AS 'RIGHT'
编号:154448887859999
左:1544
长度:15子串
:9999
右:空