function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sonu06Sonu06 

single query to fetch lead and contacts in datatable using LWC

Hi,
I want to fetch the records of contacts and leads using a single query to display it into the datatable using lightning web component,
please help me to solve this issue.
ANUTEJANUTEJ (Salesforce Developers) 
Hi Sonu,

Are you looking for a way to fetch data for contacts and respective leads in that case can you try checking below query:

>>SELECT id,name,(SELECT id from Lead) from Contact

Let me know if it works.

Regards,
Anutej
Sonu06Sonu06
No,, I want to fetch unrelated contacts and lead records in datatable using single query,:and to show them in datatable in Web component, is this possible ??