| |
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
|
| October 10, 2008 10:22:02 |
#4 |
| akhilbest |
Member Since: October 2008 Total Comments: 1 |
RE: Data Conversion |
| insert into emp2(first_name,last_name) (select substr(ename,1,instr(ename,',')-1) ,trim(',' from substr(ename,instr(ename,','))) from emp1 ) |
| |
Back To Question | |