June 23, 2009 at 6:17 am
CREATE TABLE TEST(name varchar(50));
INSERT INTO TEST VALUES('My Name IS');
INSERT INTO TEST VALUES('YOUR Name IS');
INSERT INTO TEST VALUES('THIS IS SAMPLE');
OUTPUT:
My Name IS
YOUR Name IS
THIS IS SAMPLE
I want to update a table to remove space in string.AND OUTPUT LIKE
OUTPUT:
MyNameIS
YOURNameIS
THISISSAMPLE
June 23, 2009 at 6:24 am
Try this
Update Test set name = replace(name,' ','')
June 23, 2009 at 6:25 am
the REPLACE command is what you want:
SELECt Replace(columnname,' ','') As Columname from YourTable
it might be hard to see, but the command is singlequote-space-singlequote for WHAT to replace, and is two single quotes with nothing between them for the replace with an empty string
Lowell
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply