Topic: Miscellaneous >> SQL query with 2 different Schemas
|
Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property.
You may review the entire Oracle Certification Program Candidate Agreement online Here.
|
|
|
|
| Title: SQL query with 2 different Schemas |
| sathi |
Posted: Jun 01, 2007 02:16:08 AM |
Total Post: 5
Joined: Feb, 2007
|
Hi,
I want to fetch and compare data from two different schemas/users in a single SQL query.
I have 2 different users named user1 and user2. I have different table names but with the same column names. I want to join the two users user1 and user2 and compare the same columns.
Any help on this is highly appreciated.
Thanks in advance. |
|
|
Vigyan |
| Posted: Jun 04, 2007 11:16:50 AM | |
|
Total Post: 386
Joined: May, 2001
|
You can use grant to select table from another schema.
e.g.
Grant select on table_name to user1;
now from connect as user1 and write the sql statement like below.
select a.col1, b.col1 from user1.table_name1, user2.table_name2 where ....
Hope this helps.
Vigyan
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |
|
|
|
|
Forum Rules & Description
Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user
|
| |
Get FREE Magazines
|
Top 10 Forum User
|
| Murtuja Khokhar | 857 |
| Mohammed Taj | 746 |
| positive fanatic | 483 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 386 |
| Vinoth Kumar | 357 |
| Gopu Gopi | 340 |
| Gitesh Trivedi | 322 |
| neeraj sharma | 258 |
| Ramesh Jois | 246 |
|
|