Sql-server – Remove last character in selected column

sql serversql-server-2008-r2

Query:

select * from aa;

Output:

ID  FirstName   LastName    City
-----------------------------------
29  Abcrdrr     hai         chennai
67  adf         adsd        adsf
1   John        vinoth      CITY

I want to display the lastname column without last character. I am using following queries:

Declare @name as varchar(100);

select @name = city from aa
Select @name, left(@name, len(@name)-1) as AfterRemoveLastCharacter

But output will come first row only

Best Answer

"The first shall be last, and the last shall be first"

REVERSE(STUFF ( REVERSE(lastname), 1, 1, ''))