Home » SQL & PL/SQL » SQL & PL/SQL » Distributed Names
Distributed Names [message #377331] Mon, 22 December 2008 07:56 Go to next message
*munnabhai*
Messages: 157
Registered: March 2008
Location: Riyadh
Senior Member
is there any query to distribute a name in three column like below

select emp_name from employee;

EMP_NAME

--------------------------------------------------
Alistair Cook Steve

select first_name,second_name,last_name from new_employee;

FIRST_NAME SECOND_NAME LAST_NAME

---------- ------------- --------------
ALISTAIR COOK STEEVE

anyone help me how can i do this ?
Re: Distributed Names [message #377337 is a reply to message #377331] Mon, 22 December 2008 08:02 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Always post your Oracle version (4 decimals).

Also always post a Test case: create table and insert statements along with the result you want with these data.

You can easily used SUBSTR and INSTR functions, or if you are in 10g and up REGEXP_SUBSTR.

Regards
Michel

[Updated on: Mon, 22 December 2008 08:02]

Report message to a moderator

Re: Distributed Names [message #377343 is a reply to message #377337] Mon, 22 December 2008 08:07 Go to previous messageGo to next message
*munnabhai*
Messages: 157
Registered: March 2008
Location: Riyadh
Senior Member
sorry cadot for the caps im using...i will recheck my query before posting next time.

anyhow im using oracle 9i.

Regards
Re: Distributed Names [message #377355 is a reply to message #377343] Mon, 22 December 2008 08:34 Go to previous message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
sorry cadot for the caps im using...

Where did I talk about caps?

Quote:
anyhow im using oracle 9i.

But I asked for version with 4 decimals.

Anyway you have the answer INSTR and SUBSTR.

Regards
Michel
Previous Topic: Inserting and Deleting
Next Topic: error message : Warning: compiled but with compilation errors
Goto Forum:
  


Current Time: Sat Dec 10 16:34:03 CST 2016

Total time taken to generate the page: 0.10328 seconds