+ Start a Discussion
QueueMeQueueMe 

how to eliminate records that doesn't have children in SOQL parent to child relationship

Hi i try to eliminate records that doesn't have children in this query :

 

[SELECT Id , (SELECT id FROM ActivityHistories) FROM Lead

 

By the way i tried to make inner join between leads and ActivityHistory but the system give me that you can't make inner join between these two objects.

 

-Thanks

veeranjaneyuluveeranjaneyulu

Hi,

with out any relationship directly delete the records in particular object

 for exp: list<object>obj=[select id,name from account ];

delete obj;

with in relation ship :

for exp:list<object>obi=[select  id,(select id,name from object1) from object];

delect obj;

QueueMeQueueMe

Hi,

 

Thank you for reply , but i need to eliminate the records from the result only i mean to "filter the records" not to delete it.