Try:
SELECT * FROM s2j_sabai_entity_field_directory_contact AS contact
LEFT JOIN s2j_sabai_directory_claim AS claim ON claim.contact = contact.id
I assume you have some connection there between the two tables, correct?
If both tables have the same field names, you may want to select them outright instead of using *.
Thread Starter
RC2102
(@rc2102)
Thank you Scott… I have updated the code
SELECT * FROM s2j_sabai_entity_field_directory_contact AS contact
LEFT JOIN s2j_sabai_directory_claim AS claim ON claim.claim_entity_id = contact.entity_id
but returned one line with the correct details. There are 2 fields which are similar but they don’t have the same name which are claim_entity_id and entity_id
The following are fields which I want to get data from which I have added in the Fields (optional) section from the settings of the plugin:
Claim Entity Id > s2j_sabai_directory_claim
Claim Name > s2j_sabai_directory_claim
Claim Email > s2j_sabai_directory_claim
Claim Entity Bundle Name > s2j_sabai_directory_claim
Claim Status > s2j_sabai_directory_claim
Mobile > s2j_sabai_entity_field_directory_contact
Phone > s2j_sabai_entity_field_directory_contact
Email > s2j_sabai_entity_field_directory_contact
Website > s2j_sabai_entity_field_directory_contact
Entity Id >s2j_sabai_entity_field_directory_contact
When adding the fields into Exports and Reports, put their field name such as “claim_name” and put as the “Real Name” the full path, such as “claim.claim_name” (alias must be included for the Real Name).
Let me know how that helps.