Insert records from other table using insert statement:
Scenario: I need to insert records into the table after fetching records from other table.
Query:
-- Creating the table and inserting records.
create table venkat (id int, id1 int)
create table venkatSecondTable (id int, id1 int)
insert into venkat values(1,2)
-- Check whether data is there
insert into venkatSecondTable select ID,id1 from venkat
select * from venkatSecondTable
Cheers,
Venkatesan Prabu .J
No comments:
Post a Comment