sql server - How can remove spaces from the both side of a column -
i have table t1, t1 table should contain column lname
. value of lname
have space on both side.
i want retrieve name lname
, remove spaces both side.
help me.
you can use ltrim , rtrim in conjunction remove spaces both sides
select rtrim(ltrim(lname)) lname t1
see msdn documentation on function https://msdn.microsoft.com/en-us/library/ms177827.aspx
sql fiddle demonstration http://sqlfiddle.com/#!6/ec068/1
Comments
Post a Comment