Hello Experts !
I have two tables
Order Header and Order Lines
Let us see one test example
create table order_header
(order_id int primary key, order_number varchar2(30) , qty decimal(2,0))
insert into order_header
values
('001','XX001',40)
create table order_lines
(order_id int, order_line_id int primary key , product_name varchar2(20))
INSERT INTO ORDER_LINES
VALUES
('001',1,'COLGATE')
INSERT INTO ORDER_LINES
VALUES
('001',2,'PEPSODENT')
SELECT * FROM ORDER_HEADER A
INNER JOIN ORDER_LINES B
ON(A.ORDER_ID = B.ORDER_ID)
Output is:
order_id--order_num--qty--order_id--order_line_id--product
1-------------- XX001------- 40-----1--------------1----------------COLGATE
1--------------XX001--------40----1-------------- 2-------------- PEPSODENT
I want to add extra custom column which contains [Header and Detail value]
In above example ! Order 1 have 2 lines ! so output shown 2 rows..
Header table contains always one row and lines contain multiple rows but In header row the cusom column should have "HEADER" value and rest of the rows related to that
header should have "LINES" how can I achieve this?
I am using oracle database 10g
tool is toad 10.
Regards,
ChinTOoo