473,396 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

merging two tables

Hiiiiii
There are two tables having the same name in two schemas......
I want add some rows from one table to another...........
Please suggest a sql query to perform that operation..........
Mar 15 '07 #1
1 2252
mivey4
37
Hiiiiii
There are two tables having the same name in two schemas......
I want add some rows from one table to another...........
Please suggest a sql query to perform that operation..........
You should use the [schema.]table_name model to do this.

For example:

If the name of the table is "myTable" and this table is located in Joe's schema
and the other in kanthi84 (AND the schema's are identical). you could
use a query like this to do a selective insert from joes table to yours -

insert into kanthi84.myTable
select columnName1, columnName2 from joe.myTable where columnName = 'unique_condition';

or insert all the rows from one table to the other

insert into kanthi84.myTable
select * from joe.myTable;

A couple of things to consider though:
1. You must have the select any table privilege to do this
2. If you're logged in as yourself you don't neccessarily have to prefix the
table with your name since it is implicitly presumed by ORACLE.
3. The example presumes that there are only 2 columns in both tables since the insert must contain the same number of values that both tables contain.

Hope this helps!
Mar 15 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Walt Borders | last post by:
Hi, My problem: Merging two datasets deletes parent elements, preserves all children. I've created two dataSets. Each use the same schema, parent-child nested tables. The first dataSet is...
3
by: Patrick | last post by:
I have got 2 XML documents, both of which conform to the same XSD Schema, which define possible optional elements. The 2 XML documents contain 2 disjoint set of XML elements. What is the best,...
2
by: Emmett Power | last post by:
Hi, I have an Access table with a number of records which refer to the same person but with data in different fields. So for example the table would look like this: Name..............Field...
1
by: svdh | last post by:
I have posed a question last saturday and have advanced alot in the meantime. But I am still not there Problem is that I try to merging various fields from various tables in one document in Word...
2
by: Dan Cooper | last post by:
I've got two datasets, each containing a single data table. dstDataSetA.Tables("TableA") dstDataSetB.Tables("TableB") I want to merge them together and delete any non-matching rows. ...
7
by: Jon Vaughan | last post by:
I have 2 datasets , one returned as a dataset from a webservice and one created client side form the same stored procedure that is returned from the webservice. I then try and merge the data, but...
1
by: actimel01 | last post by:
I know this question has been asked many times before but I can't find an answer that fits my data! I have two Access databases. The tables in each have the exactly the same fields except for one...
0
by: =?Utf-8?B?QmFkaXM=?= | last post by:
Hi, I'm trying to do mail merging in C#.NET and in one methods: Word.Application wrdApp; Word._Document wrdDoc; Object oMissing = System.Reflection.Missing.Value; Object oFalse = false; ...
7
by: =?Utf-8?B?QmFkaXM=?= | last post by:
Hi, I'm trying to follow a mail merging example in C#.Net that I got from: http://support.microsoft.com/default.aspx/kb/301659 and in one the methods: Word.Application wrdApp; Word._Document...
2
by: Neil Chambers | last post by:
I am trying to get my head around dataset merging but despite a little research I could still use a pointer (or ten). Basically I want to perform an outer join operation on a dataset (created from...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.