I have table1(master table) consists of four columns(col1,col2,col3,col4).Another table table 2 is present.I have to join these two tables
based on col1,col2,col3 for few records and col1,col2,col3,col4 for few records,col1,col2 for few records.
currently i am using 3 join stages.Is there any way can i
use one join stage instead of three?because my key columns are not constant and it may be 1,2,3,4 columns.
Join based on variable no of key columns
Moderators: chulett, rschirm, roy
What are your join rules, how do you determine which 'few records' get which combination of keys?
Last edited by chulett on Mon Sep 07, 2015 1:43 pm, edited 1 time in total.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
1)one set of records
col1='A',col2='B' and col3='C'
for the above set i need to join based on 3 three columns
2)another set of records
col1='D',col2='E'
for the above set i need to join based on 2 columns
3)another set of records
col1='e',col2='f' and col3='g' and col4='h'
for the above set i need to join based on 4 columns
col1='A',col2='B' and col3='C'
for the above set i need to join based on 3 three columns
2)another set of records
col1='D',col2='E'
for the above set i need to join based on 2 columns
3)another set of records
col1='e',col2='f' and col3='g' and col4='h'
for the above set i need to join based on 4 columns
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 342
- Joined: Tue Nov 04, 2008 10:38 am
- Location: Chennai, India