sql
This is a discussion on sql within the Oracle Database forums, part of the Database category; hai can any one tell this query having the table emp emp_id emp_name 01 john paul 02 ravi kumar 03 ...
-
sql
hai
can any one tell this query
having the table emp
emp_id emp_name
01 john paul
02 ravi kumar
03 hari babu
when retriving the record i want the query output of emp_name is
paul john
kumar ravi
babu hari
if any one knows this please reply me
-
11-22-2006, 08:24 AM #2
- Join Date
- Nov 2006
- Location
- Bangalore, India
- Answers
- 16
hi,
select substr(emp_name,instr(emp_name,' ',2,1),length(emp_name))
||' '|| substr(emp_name,1,instr(emp_name,' ',2,1)) name1
from emp
i think this query will do it for you..
hope it helps,
regards
Raj
-
sriharid did you try sarunraj suggestion. he haas given a good suggestion.You should get the output. Let us know the result.
-
12-15-2006, 08:00 AM #4
- Join Date
- Dec 2006
- Answers
- 3
SQL> select emp_id,substr(emp_name, instr(emp_name,' '))||' '||
substr(emp_name,0,instr(emp_name,' ')) from emp1;
-
Sponsored Ads


Reply With Quote





