Question

Join two unrelated tables side-by-side

Rating8.9Very Good

I want to query two tables show the results side-by-side. I'm struggling to work it out for myself so hopefully someone here can help. It is important that the two sides can be ordered independently.

PEOPLE table:

NAME | AGE
----------
DAVE | 43
ANNE | 25
MIKE | 58

PLACES table:

COUNTRY | TOWN
----------------
USA     | WILMINGTON
GER     | BERLIN
POR     | LISBON
JPN     | KYOTO

Query something like:

select * from PEOPLE order by AGE asc
-join-
select * from PLACES order by TOWN asc

Result like:

NAME | AGE | COUNTRY | TOWN
-----------------------------
ANNE |  25 | GER     | BERLIN
DAVE |  43 | JPN     | KYOTO
MIKE |  58 | POR     | LISBON
           | USA     | WILMINGTON
                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:

Select allOpen in new window

  1. can two sequence no be associated with 1 table
    table will insert vales 20, 21, 22 from sequence_A and 50, 51,52... from SEQUECE_B
  2. Compair two tables
    I need to write a procedure which takes two parameters server1.tableA and server2.TableA. The structures of both tables are same but reside on different servers. I need to write a procedure which takes two parameters server1.tableA and server2.TableA. The structures of both tables are same but reside on different servers. I …
  3. hi i am having a table of million records but i need …
    hi all, i am havng a tabl of many rows on it, but i need only 200 latest rows which is inserted in that tables. i dont have any ate stamp or seqid in that table. i am having a dobt with rowid? is we can use rowid for this? i am having a query which i will get latest record but i need latest 200 records in that table.... select * from emp where ro…
  4. join two queries -- oracle
    I have got these 2 queries, I am trying to join them. Can anybody help me in joining them?
  5. Join two tables.
    Hi folks, I have two tables which I want to join. Both tables have one column in common called roll_no. I want two columns from table 1 (class, roll_no) and four columns from table 2 (roll_no, grade, name, address). So the final outcome of the query should be something like: Class, Roll_no, Grade, Name, Addre…

Solution

Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.

About this Solution
View This Solution - Start Your 30 Day Free Trial
Zone
Troubleshooting
Tags
Participating Experts
5
Solution Grade
A

Replies

 
by: cyberkiwi

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: angelIII

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: cyberkiwi

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by:

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: virdi_ds

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: theskintman

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: markgeer

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: awking00

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: theskintman

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

Stay Connected

Oracle Around the Web

The latest Oracle news, tips, and tricks

Oracle Unveils Netra SPARC T3 Servers

New Carrier-Grade Blade and Rackmount Servers Deliver Better Performance, Density and Power Efficiency for the Communications Industry ...

read more

Oracle fixes 21 flaws in Java SE, Java for Business

Oracle is fixing 21 flaws in its Java SE and Java for Business products in its February critical patch update issued this week ...

read more

Obama’s Silicon Valley “Tech Supper”

Why was he there? Who wasn’t invited and why? What did they talk about? Why was he really there? These are the questions being debated ...

read more

Featured Oracle Experts

slightwv

slightwv has answered more than 2,000 Oracle questions and oversees database management within the U.S. Government. Slightwv

sdstuber

A regular presenter at the Collaborate conference, Oracle developer sdstuber is a top expert in PL/SQL and Oracle 9, 10 and 11. sdstuber

Testimonials

What users are saying about our experts

"The Oracle gurus provide answers, solutions and valuable workarounds"

User: schwertner

"Wow! Excellent, valuable explanation. Hats off to you"

User: aseshu70

"Solution worked fantastic and performs excellent! Thanks heaps"

User: klausbrandlhuber

Top Experts

  1. sdstuber

    2,000

    0 points yesterday

    Profile

BrowseBecome an Expert