| |
GeekInterview.com > Interview Questions > Oracle > SQL
| Print | |
Question: Data Conversion
Answer: Have 2 table Emp1 (Column Name: Ename), 2nd table Emp2 (Column Name: First and Column Name: Last
Table Name :Emp1 EName Hunt, Michael Graham, Smith Nelson, Ryan
Table Name: Emp2 First Last Michael Hunt Smith Graham Ryan Nelson
Need to write a SQL query to convert the data from Emp1 to Emp2 in this way. Can any body help me.
Thanks
|
| January 01, 2009 13:52:02 |
#5 |
| Vishuraj |
Member Since: January 2009 Total Comments: 3 |
RE: Data Conversion |
| Insert into emp2select substring(ename,0,charindex(',',ename)),substring(ename,(charindex(',',ename)+ 1),40) from emp1This will insert into emp2 as First name and Lastname. |
| |
Back To Question | |