Home inner join on table with multiple record
Reply: 0

inner join on table with multiple record

user1067
1#
user1067 Published in June 25, 2018, 7:12 pm

I have two tables as follows

table1

column1|column2
----------------
a1     | c1
----------------
a2     | c2

table2

column1|column2|column3
----------------------
1      | a1    | x
-----------------------
2      | a1    | y
-----------------------
3      | a1    | z
-----------------------
4      | a2    | ab
-----------------------
5      | a2    | cd
-----------------------
6      | a2    | ef

Table1 is the parent table and table2 is the child table.

Column1 of table1 is mapped to column2 of table2.

Table2 can contain multiple records for each entry of column1 in table1 some thing like this.

I want to join table1 to table2, but I want only the first record of all entries of table2.

So my result set will be

column1|column2|column3
----------------------
1      | a1    | x
-----------------------
2      | a2    | ab

How to make a join to achieve this in oracle 11 g. I use sql navigator +

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.31899 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO