Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i creat a join or union? 1

Status
Not open for further replies.

jmgs98

MIS
May 10, 2004
9
0
0
MX
I need to put together the information of two tables in different schemes that are in different hosts....

1. I do not know if the best will be to do a join or Union
2. How the command shoudl go?

Create View view_name [column name] as
select [column_name] from host.tablename

how should indicate the procedence from different shemes...

3. should i create it under SQL*Plus?

I know my questions are basic but i want to make sure we are doing the appropiate.

Thanks.
 
1. Whether Join or Union is best will depend on how many rows you are dealing with on the remote and local servers. Probably the best way to answer that question is to try it both ways and see which is better for you.

2. Assuming one table is on a remote server and the other is on a local server, the command would be something like:
CREATE VIEW view_name AS
SELECT l.col1, l.col2, r.col3
FROM local_table l, remote_table@remote_TNS_alias
WHERE l.col1 = r.col2;

3. SQL*Plus would be one way, but not the only way - use whichever tool you prefer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top