write a query

I have a question,
                                    Suppose that I have a table and the table contains a text column and column contains few rows and rows is:----
                                                                                           
                                                  the first row: ----               I am not sure what is this
                                                  The Second row:--            abs text row
                                                  The Third row:---              text column
                                                  The Fourth row:--             text

Question:----Write a query to display each row last word in this column.?
Varun GaurAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vitor MontalvãoMSSQL Senior EngineerCommented:
Is this a kind of homework?
For what you want you'll need, it will be more easy with the REVERSE function:
SELECT TextField, REVERSE(LEFT(REVERSE(TextField), CHARINDEX(' ',REVERSE(TextField))))
FROM TableName

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Varun GaurAuthor Commented:
Thank you, Sir, I really appreciate Sir,

This is very useful.
but I forget REVERSE function so only this issue.

I have another question, sir,

Suppose that, I have a table and table contain an email column. email ------- varun.gaur@ gmail.com alok.varma@gmail.com sanjeevsharma@gmail.com lalitchaudhary@gmail.com

Question:-- Write a query to replace even character with hash symbol(#) and each row contains Gmail domain as it is, like this--- v#r#n#g#u#@gmail.com


Please write the best query sir as soon as possible
0
Vitor MontalvãoMSSQL Senior EngineerCommented:
Author, you can't accept your own answer when the only thing you did it was to make another question, not even related to this one.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Vitor MontalvãoMSSQL Senior EngineerCommented:
Object the close request by the author by the reasons mentioned above.
0
Vitor MontalvãoMSSQL Senior EngineerCommented:
Really The Experts Exchange is very knowledgeable and excellent team.
I appreciate you.
We also appreciate when the users give us credits for helping them so please close this question accordlying.
0
Varun GaurAuthor Commented:
I really happy with Expert Exchange. It provides the best solution
0
Vitor MontalvãoMSSQL Senior EngineerCommented:
Recommendation to close this question by accepting the above comment as solution.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.