Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I Have one requirement like below.
Example: I ahve two tables Table _1 and Table_2.
Table_1:
Field1,
Field2,
Field3,
Field4
From................
Table_2:
Field1,
Field2
,Field3,
Field5,
Field6
From..................
Requirement is : I want to load only Where Field2=Field2 and Field3=Field3 from Table_1
Can any one tell me how to do this ,any help would be appreciated,
Thanks in advance
.
Can i use like this , if I have more then three tables
Table_1:
LOAD Field1,
Field2,
Field3,
Field4
FROM....
Left join
Table2:
LOAD Field1,
Field2,
Field3,
Field4,
Field5,
Field6
FROM....
Left Join(Table_1)
Table_3:
Field3 ,
Field7
From.......
The question wasn't (IMHO) very clear; for a 2 tables result I thought at my or Sunny's answer (it depends if the check was on a single row for both the fields --> my answer or in many rows --> Sunny's answer).
For a 1 table result maybe a left or inner join.
Of course you can.
The only thing you have to take care of is this: each successive JOIN may duplicate the records that are already present in your original table. For example, if your table_1 contains:
Field1, Field2, Field3
ABC, 2/5/2015, $1000
left joining the following to table_1
Field1, Field4
ABC, CostCenter8012
ABC, CostCenter8200
will produce this new version of Table_1:
Field1, Field2, Field3, Field4
ABC, 2/5/2015, $1000, CostCenter8012
ABC, 2/5/2015, $1000, CostCenter8200
which may not be what you expect.
The order in which you perform multiple successive JOINs is extremely important. But since you keep to the dummy field names (I haven't got any idea what they will be used for), we cannot advise on the real impact of your examples.
Best,
Peter
If i dont want duplicate records, What should i do ?
You should think it over. You can always ask yourself: does the table I want to join to an existing table contain multiple records per distinct join field value?