You need to sign in to do that
Don't have an account?
PBS_IC786
SOQL Query Help -- multiple joins
How can I structure a statement so that I can pull data from fields in 3 different custom objects which have a lookup relationship with 1 custom object? Also, once I do that, how can I hold that dataset and do calculations against it before presenting the results on an scontrol?
Any help is greatly appreciated...
look in the child-relationships to pull those in.
Thank you Ron. That was helpful but now I have a new dilemna. Does soql support aggregation? I can't seem to find any documentation on a sum() function. I would like to sum all of the values returned for one of my custom objects' fields...any way to do this?
Any help is greatly appreciated...
least wise thats what i do.
we have count (counts records on a query) orderby and limit
no sum or unique or ...
Select Name, Parent.Name, Parent.Id, ParentId FROM Attachment WHERE Parent.Id = 'xxx'
using the eclipse schema viewer?
I get an error if I try, but the query does run correctly in my s-control.
I can run a query like Select Name, ParentId, Id FROM Attachment LIMIT 10, but that's not really what I'm going for.
SELECT Name, Parent.Id, Parent.Name, ParentId FROM Attachment where ParentId = 'xxx'
Above query seems to be fine. But the one bellow is failing:
SELECT Name, Parent.Id, Parent.Name, ParentId FROM Attachment where Parent.Id = 'xxx'
with error: MALFORMED_QUERY: Illegal filter on Attachment
Yes, I see now I ended up changing the query to
Select Name, Id, Parent.Name, Parent.Id, ParentId FROM Attachment Where Parent.Name = 'xx'.
I'm still curious whether the Eclipse explorer would do a query like this though, because I get a java.lang.reflect.targetInvocation error when I try to run queries that use the SOQL joins.
Is the sum() function introduced as this really helps, there is a huge lag time if you are waiting to load all records into memory espicially if you have 10000 to 15000 records
Regards
Vivek Viswanathan
Associate Consultant-CRM Solutions Group
STC StraightThrough Inc.
Select a.Id, a.Name, a.Owner.LastName, a.Owner.FirstName From Attachment a where a.ParentId='a0I500000016QTG' and a.Owner.Id in(ids) order by a.Owner.LastName
But when someone else is logged in, it doesn't work.