| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Break up a field into multiple rows
I am trying to break down a string into 2 words and return them in
separate rows (with the same data in the other fields). So if I have
a row with columns A,B,C where C is a string with 2 words (separated
by a space), I want a query that will return A,B,C1 and A,B,C2. For
example:
create table sales_orders (
order_number int not null primary key,
sales_rep varchar(20) not null,
item varchar(20) not null,
quantity int not null,
territories varchar(20) not null
);
insert into table sales_orders values ( 1, 'todd', 'widget', 5, 'east north' );
I am trying to create a query that will return 2 rows:
( 1, 'todd', 'widget', 5, 'east' )
and
( 1, 'todd', 'widget', 5, 'north' )
Any ideas?
Todd
Received on Fri Oct 25 2002 - 18:14:12 CDT
![]() |
![]() |