How do I replace only the last character of the string:
select REPLACE('this is the news with a t', 't', '__')
The result I'm getting is:
__is is __e news wi__ a __
EDIT
The collation of the server and the database is Latin1_General_CI_AS
The actual query I'm running is REPLACE(note, 't', '')
where note
is an ntext
column. The point is to strip out the thorn characters because that character gets used later in the process as a column delimiter. (Please don't suggest changing the delimiter, that's just not going to happen given the extent to which it's been used!)
I've tried using the N
prefix even using the test select statement, here are the results:
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…