You need to sign in to do that
Don't have an account?
textual
running soql in eclipse, not getting count field to show
from here:
SELECT Name, Count(Id)
FROM Account
GROUP BY Name
HAVING Count(Id) > 1
i can see the field expr0, but it doesnt show the actual count :(
is there another tool to run soql other than eclipse?
try use AggregateResult in execute anonymous see below.
aggregateresult[] ag1 = [SELECT Name, Count(Id)mycount FROM Account GROUP BY Name HAVING Count(Id) > 1];
for(aggregateresult ag2:ag1){
system.debug('name=' + ag2.get('name') + ' ' + 'count=' + ag2.get('mycount'));
}
13:10:03.029 (29208000)|EXECUTION_STARTED
13:10:03.029 (29224000)|CODE_UNIT_STARTED|[EXTERNAL]|execute_anonymous_apex
13:10:03.030 (30652000)|SOQL_EXECUTE_BEGIN|[1]|Aggregations:0|select Name, COUNT(Id) mycount from Account group by Name having COUNT(Id) > 1
13:10:03.200 (200730000)|SOQL_EXECUTE_END|[1]|Rows:1550
13:10:03.204 (204678000)|USER_DEBUG|[4]|DEBUG|name=jeff count=2
13:10:03.204 (204855000)|USER_DEBUG|[4]|DEBUG|name=eugene count=6
cool...but where do i put this code?
do i have to create a page, controller and class to run this?
try force.com explorer! Excellent tool to play around!
http://wiki.developerforce.com/page/ForceExplorer
it would solve all your issues. since eclipse depends with java patches it does not work properly for soql!
let me know if it works for you!
baskaran