Showing posts with label john. Show all posts
Showing posts with label john. Show all posts

Wednesday, March 28, 2012

Remove Duplicate Data but Keep One

I have the following:

ID FNAME LNAME
1 John Doe
1 John Doe
1 John Doe
2 Joe Doe
2 Joe Doe
2 Joe Doe
3 John Jones
4 Foo Foo

I would like to end up like the following:

ID FNAME LNAME
1 John Doe
2 Joe Doe
3 John Jones
4 Foo Foo

Thanks for any advice
JESELECT DISTINCT * INTO someothertable FROM yourTable

DROP yourTable

RENAME someothertable TO yourTable

Monday, March 26, 2012

Remove a $ from data field

Hello All,

Here is my employee table below with data:
EMPLOYEE
LastName FirstName UserName
Doe John doej$
Smith Lee smithl
Steele Michael steelem$
Tyler Brandon tylerb$
Green Andy greena
Scott Steve scotts$
Parks Joe parks$j
And many more

I would like to remove all $ sign in the data of UserName. Please Help!
Thanks,

Quote:

Originally Posted by questionandanswer

Hello All,

Here is my employee table below with data:
EMPLOYEE
LastName FirstName UserName
Doe John doej$
Smith Lee smithl
Steele Michael steelem$
Tyler Brandon tylerb$
Green Andy greena
Scott Steve scotts$
Parks Joe parks$j
And many more

I would like to remove all $ sign in the data of UserName. Please Help!
Thanks,


use the replace functionsql