You need to sign in to do that
Don't have an account?
WT007
Self Join in SoQL
Hello,
Im trying to accomplish something like this:
select a.id,
a.MY_DUPEID__c,
a.FirstName,
b.Firstname as Firstname_Orig
from Lead a
LEFT JOIN
lead b
on a.my_dupeid__c =b.id
WHERE
MY_DUPEID__c !=NULL
This has to be returned in 1 query.
Thanks in advance!
What type of field is this "MY_DUPEID__c"?
If it is a lookup then you should be able to say:
select a.id, a.MY_DUPEID__c, a.FirstName, a.my_dupeid__r.Firstname as Firstname_Orig from Lead a
The my_dupeid__ is just a custom field that contains the corresponding id field in the same leads table (that is duplicate of current record). Im trying to write some SOQL to get all these records back in one recordset.
Thanks.
So, What is the field Type for "my_dupeid__c"?
Lookup, text, MasterDetail, Formula,... ?