Home » SQL & PL/SQL » SQL & PL/SQL » Insert missing row
Insert missing row [message #231596] Tue, 17 April 2007 12:20 Go to next message
Priya_reddy
Messages: 11
Registered: April 2007
Junior Member

How can I insert missing row from one table to another ?

Please give me some link or clue.
Re: Insert missing row [message #231598 is a reply to message #231596] Tue, 17 April 2007 12:21 Go to previous messageGo to next message
skooman
Messages: 912
Registered: March 2005
Location: Netherlands
Senior Member
How do you define "missing"?
Re: Insert missing row [message #231599 is a reply to message #231596] Tue, 17 April 2007 12:24 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
by using
INSERT INTO .....
Re: Insert missing row [message #231604 is a reply to message #231596] Tue, 17 April 2007 12:37 Go to previous messageGo to next message
Priya_reddy
Messages: 11
Registered: April 2007
Junior Member
I need to include a way to look for rows that are in one table and not the other

Insert the rows that exist in the one table, but are missing from the master table
Re: Insert missing row [message #231613 is a reply to message #231596] Tue, 17 April 2007 13:02 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
>I need to include a way to look for rows that are in one table and not the other
Based upon what criteria?

SELECT FROM MASTER
MINUS
SELECT FROM MISSING
Re: Insert missing row [message #231618 is a reply to message #231596] Tue, 17 April 2007 13:35 Go to previous messageGo to next message
Priya_reddy
Messages: 11
Registered: April 2007
Junior Member
I have two table like A and B.

I have to insert rows into table B.(that rows which are exist in table A, but missing from table B)

Re: Insert missing row [message #231624 is a reply to message #231596] Tue, 17 April 2007 14:16 Go to previous messageGo to next message
Bill B
Messages: 1482
Registered: December 2004
Senior Member
insert into b
select * from a
minus
select * from b;
Re: Insert missing row [message #231625 is a reply to message #231618] Tue, 17 April 2007 14:20 Go to previous message
gururajster
Messages: 26
Registered: October 2006
Location: bangalorre
Junior Member

Hi,

First you need to tell me whether the table A and table B are both same but one row is missing in B.
Let me give u a answer, once this question is answered by you.

-Guru
Previous Topic: add column not null in a not empty table
Next Topic: procedure within a trigger
Goto Forum:
  


Current Time: Sun Dec 04 17:01:49 CST 2016

Total time taken to generate the page: 0.07496 seconds