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

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

php - How do you embed a video into a custom theme on WordPress? -