Hi friends
My first table contain one row
My second table contain three rows
for example
In first table
1) 10022 kathir
In second table
1) 2002 morning
2) 2003 evening
3)2004 day
I want to enter as below in a new table
10022 2002
10022 2003
10022 2004
How can i make query for this result.please help me
How can insert multiple row value to single row value
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Sep 3, 2012, 8:41 PM EDT
create table tbl1
(EmpId int,
EmpName varchar(50))
create table tbl2
(empyear int,
Period varchar(50))
create table tbl3
(EmpId int,
empyear int)
insert into tbl1 values(10022,'Kathir')
insert into tbl2 values(2002,'morning')
insert into tbl2 values(2003,'evening')
insert into tbl2 values(2004,'day')
Insert into tbl3 select EmpId,empyear from tbl1,tbl2
select * from tbl3