This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AggregateResult[] results = [SELECT LeadSource, SUM(Amount) summary | |
FROM Opportunity | |
GROUP BY LeadSource | |
HAVING Count(LeadSource) > 20]; | |
for(AggregateResult ar: results){ | |
System.debug('リードソース='+ ar.get('LeadSource') | |
+ ':金額='+ ar.get('summary')); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Account[] accounts = [SELECT Name, Phone | |
FROM Account WHERE Rating = '見込みあり']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AggregateResult[] results = [SELECT StageName, SUM(Amount) summary | |
FROM Opportunity | |
WHERE IsClosed = false | |
GROUP BY StageName]; | |
for(AggregateResult ar: results){ | |
System.debug('フェーズ='+ ar.get('StageName') | |
+ ':金額='+ ar.get('summary')); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AggregateResult[] results = [SELECT SUM(Amount) summary | |
FROM Opportunity WHERE IsWon = true]; | |
System.debug('受注金額合計=' + results[0].get('summary')); |
NewerOlder