+ Start a Discussion
ArpiArpi 

Left join,right join and inner join with 2 unrelated tables

All,

 

I have a reuirement in whivh I have 2 tables with different fields.There is a field called "Unit No" in table A which should match with "Catalog No" of table B. So I want to do 3 things:-

1)Do left outer join to get all records of Table A and records of Table B with match on Unit No and Catalog No.

2)Do right outer join to get all records of Table B and records of Table A with match on Unit No and Catalog No.

3)Inner join with matching records from both tables.

 

I tried using IN but than I need Id value for comarison and my Unit No and Catalog No fields are not the name/Id field, they are normal salesforce custom text fields.

 

Any hep is greatly appreciated.

sfdcfoxsfdcfox
SOQL isn't SQL. As such, you can't perform these sorts of joins. You'll have to instead perform two queries and match them up manually.
Naveen NelavelliNaveen Nelavelli

you cannot use sql joins,but try  relationship queries..before that make sure that tables should have relationship...

otherwise you have to do manually

ArpiArpi

It is such a basic functionality for anyone doing any DB related things. Well it looks like we have to live with it for now and may be in future we may have this functionality.

 

Thanks all.