Like shown below i have 3 columns(Name,No,Address). The
values in name column i want to modity.
Requirement : Keep only once space between two words
(Fname,Lname) in the Name column.
For this what is the query? Please answer me. Advance
Thanks.


Name No Address Reference

manoj kumar
kumar raja
vinzay kumar
rajendra prasad
gowri nath -- -- --

Answer Posted / lince

select substring(NAME,1,charindex(' ',NAME))+' '+
replace(substring(NAME,charindex(' ',NAME),len(NAME)),' ','')
as NAME from test

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between unique and primary key constraints?

582


What is sql key?

509


where are cookies actually stored on the hard disk? : Sql dba

574


Explain the steps needed to create the scheduled job?

552


How does cross join work?

498






What is the maximum number of columns in sql table?

544


What is a system versioned table?

525


What are the types of operators available in sql?

546


How to generate a salary slip like jan 1000 1000 feb 1000 2000 ... dec 1000 12000

1634


What is the most restrictive isolation level? : Transact sql

548


What is the difference between the conventional and direct path loads? : aql loader

687


What are stuff and replace function?

566


is it possible to pass an object or table to a procedure as an argument?

563


How do I find duplicates in two columns?

544


What is transaction control language (tcl)?

629