Reputation: 2393
I have a column as name which is having a results like.
name
ABC
XYZ
ader
fer
I want to remove the blank space before ader and it should print in the output like ader.
How to achieve that?
Upvotes: 0
Views: 45
Reputation: 1269513
Depending on your database you can use trim()
, ltrim()
/rtrim()
, or replace()
:
select replace(name, ' ', '')
select trim(name, ' ')
select ltrim(rtrim(name))
Upvotes: 2
Reputation: 31879
You can use the LTRIM
and RTRIM
functions to remove trailing and leading spaces.
SELECT
RTRIM(LTRIM(name)) AS name
FROM yourTable
Upvotes: 0