SELECT Id, Name, BillingCity FROM Account
SELECT Id FROM Contact WHERE Name LIKE 'A%' AND MailingCity = 'California'
SELECT Name FROM Account ORDER BY Name DESC NULLS LAST
SELECT Name FROM Account WHERE Industry = 'media' LIMIT 125
SELECT Name FROM Account WHERE Industry = 'media' ORDER BY BillingPostalCode ASC NULLS LAST LIMIT 125
SELECT COUNT() FROM Contact
SELECT LeadSource, COUNT(Name) FROM Lead GROUP BY LeadSource
SELECT Name, COUNT(Id) FROM Account GROUP BY Name HAVING COUNT(Id) > 1
SELECT Name, Id FROM Merchandise__c ORDER BY Name OFFSET 100
SELECT Name, Id FROM Merchandise__c ORDER BY Name LIMIT 20 OFFSET 100
SELECT Contact.FirstName, Contact.Account.Name FROM Contact
SELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = 'media'
SELECT Name, (SELECT LastName FROM Contacts) FROM Account
SELECT Account.Name, (SELECT Contact.LastName FROM Account.Contacts) FROM Account
SELECT Name, (SELECT LastName FROM Contacts WHERE CreatedBy.Alias='x') FROM Account WHERE Industry='media'
SELECT Id, FirstName__c, Mother_of_Child__r.FirstName__c FROM Daughter__c WHERE Mother_of_Child__r.LastName__c LIKE 'C%'
SELECT Name, (SELECT Name FROM Line_Items__r) FROM Merchandise__c WHERE Name LIKE 'Acme%'
SELECT Id, Owner.Name FROM Task WHERE Owner.FirstName LIKE 'B%'
SELECT Id, Who.FirstName, Who.LastName FROM Task WHERE Owner.FirstName LIKE 'B%'
SELECT Id, What.Name FROM Event
SELECT TYPEOF What WHEN Account THEN Phone, NumberOfEmployees WHEN Opportunity THEN Amount, CloseDate ELSE Name, Email END FROM Event
SELECT Name, (SELECT CreatedBy.Name FROM Notes) FROM Account
SELECT Amount, Id, Name, (SELECT Quantity, ListPrice, PricebookEntry.UnitPrice, PricebookEntry.Name FROM OpportunityLineItems) FROM Opportunity
SELECT UserId, LoginTime FROM LoginHistory
SELECT UserId, COUNT(Id) FROM LoginHistory WHERE LoginTime > 2010-09-20T22:16:30.000Z AND LoginTime < 2010-09-21 GROUP BY UserId
SELECT Id, Name, IsActive, SobjectType, DeveloperName, Description FROM RecordType
SELECT CampaignId, AVG(Amount) avg FROM Opportunity GROUP BY CampaignId HAVING COUNT(Id, Name) > 1
SELECT LeadSource, COUNT(Name) cnt FROM Lead GROUP BY ROLLUP(LeadSource)
SELECT Status, LeadSource, COUNT(Name) cnt FROM Lead GROUP BY ROLLUP(Status, LeadSource)
SELECT Type, BillingCountry, GROUPING(Type)grpType, GROUPING(BillingCountry) grpCty, COUNT(id) accts FROM Account GROUP BY CUBE(Type,BillingCountry) ORDER BY GROUPING(Type), GROUPING(Id,BillingCountry), Name DESC NULLS FIRST, Id ASC NULLS LAST
SELECT c.Name, c.Account.Name FROM Contact c
SELECT Id FROM Account WHERE (Id IN ('1', '2', '3') OR (NOT Id = '2') OR (Name LIKE '%FOO%' OR (Name LIKE '%ARM%' AND FOO = 'bar')))
SELECT LeadSource, COUNT(Name) FROM Lead GROUP BY LeadSource HAVING COUNT(Name) > 100 AND LeadSource > 'Phone'
SELECT a.Id, a.Name, (SELECT a2.Id FROM ChildAccounts a2), (SELECT a1.Id FROM ChildAccounts1 a1) FROM Account a
SELECT Title FROM KnowledgeArticleVersion WHERE PublishStatus = 'online' WITH DATA CATEGORY Geography__c ABOVE usa__c
SELECT Title FROM Question WHERE LastReplyDate > 2005-10-08T01:02:03Z WITH DATA CATEGORY Geography__c AT (usa__c, uk__c)
SELECT UrlName FROM KnowledgeArticleVersion WHERE PublishStatus = 'draft' WITH DATA CATEGORY Geography__c AT usa__c AND Product__c ABOVE_OR_BELOW mobile_phones__c
SELECT Id FROM Contact FOR VIEW
SELECT Id FROM Contact FOR REFERENCE
SELECT Id FROM Contact FOR UPDATE
SELECT Id FROM FAQ__kav FOR UPDATE
SELECT Id FROM FAQ__kav FOR VIEW UPDATE TRACKING
SELECT Id FROM FAQ__kav UPDATE VIEWSTAT
SELECT amount, FORMAT(amount) Amt, convertCurrency(amount) editDate, FORMAT(convertCurrency(amount)) convertedCurrency FROM Opportunity WHERE id = '12345'
SELECT FORMAT(MIN(closedate)) Amt FROM Opportunity
SELECT Company, toLabel(Status) FROM Lead WHERE toLabel(Status) = 'le Draft'
SELECT Id, Name FROM Account WHERE Id IN (SELECT AccountId FROM Opportunity WHERE StageName = 'Closed Lost')
SELECT Id FROM Account WHERE Id NOT IN (SELECT AccountId FROM Opportunity WHERE IsClosed = TRUE)
SELECT Id, Name FROM Account WHERE Id IN (SELECT AccountId FROM Contact WHERE LastName LIKE 'apple%') AND Id IN (SELECT AccountId FROM Opportunity WHERE isClosed = FALSE)
SELECT Account.Name, (SELECT Contact.LastName FROM Account.Contact.Foo.Bars) FROM Account
SELECT LeadSource, COUNT(Name)cnt FROM Lead
SELECT Id, Name FROM Account WHERE Name != 'foo'
SELECT Id FROM Account WHERE Foo IN ('1', '2', '3') OR Bar IN (1, 2, 3) OR Baz IN (101.00, 102.50) OR Bam IN ('FOO', null)
SELECT Id, Name FROM Account WHERE CreatedDate > LAST_N_YEARS:1 AND LastModifiedDate > LAST_MONTH
SELECT Id, CreatedById, CreatedDate, DefType, IsDeleted, Format, LastModifiedById, LastModifiedDate, AuraDefinitionBundleId, ManageableState, Source, SystemModstamp FROM AuraDefinition
SELECT Id, Name, BillingCity FROM Account WITH SECURITY_ENFORCED
SELECT Title FROM KnowledgeArticleVersion WHERE PublishStatus = 'online' WITH DATA CATEGORY Geography__c ABOVE usa__c WITH SECURITY_ENFORCED
SELECT Id FROM Account WHERE (((Name = '1' OR Name = '2') AND Name = '3')) AND (((Description = '123') OR (Id = '1' AND Id = '2'))) AND Id = '1'
SELECT TYPEOF What WHEN Account THEN Phone, NumberOfEmployees WHEN Opportunity THEN Amount, CloseDate END FROM Event
SELECT Name FROM Account WHERE CreatedById IN (SELECT TYPEOF Owner WHEN User THEN Id WHEN Group THEN CreatedById END FROM CASE)
SELECT Name FROM Account OFFSET 1
SELECT Name FROM Account WHERE Id = :foo
SELECT Name FROM Account WHERE Industry IN ('media', null, 1, 'media', 2) LIMIT 125
SELECT Name FROM Account WHERE Foo = NULL
SELECT Name FROM Account WHERE Foo = TODAY
SELECT Name FROM Account WHERE Foo = LAST_N_YEARS:1
SELECT Name FROM Account WHERE Foo = 2010-09-20T22:16:30.000Z
SELECT Name FROM Account WHERE Foo = 1
SELECT Name FROM Account WHERE Foo = TRUE AND bar = FALSE
SELECT CALENDAR_YEAR(CreatedDate) calYear, SUM(Amount) mySum FROM Opportunity GROUP BY CALENDAR_YEAR(CreatedDate)
SELECT CALENDAR_YEAR(convertTimezone(CreatedDate)) calYear, SUM(Amount) mySum FROM Opportunity GROUP BY CALENDAR_YEAR(convertTimezone(CreatedDate))
SELECT COUNT_DISTINCT(Company) distinct FROM Lead
SELECT Name, toLabel(Recordtype.Name) FROM Account
SELECT Id, MSP1__c FROM CustObj__c WHERE MSP1__c INCLUDES ('AAA;BBB', 'CCC')
SELECT Id FROM Account WHERE CreatedDate > LAST_N_FISCAL_QUARTERS:6
SELECT Id FROM Opportunity WHERE CloseDate < NEXT_N_FISCAL_YEARS:3
SELECT Id FROM Opportunity WHERE CloseDate > LAST_N_FISCAL_YEARS:3
SELECT Id, Title FROM Dashboard USING SCOPE allPrivate WHERE Type != 'SpecifiedUser'
SELECT LeadSource, Rating, GROUPING(LeadSource) grpLS, GROUPING(Rating) grpRating, COUNT(Name) cnt FROM Lead GROUP BY ROLLUP(LeadSource, Rating)
SELECT Type, BillingCountry, GROUPING(Type) grpType, GROUPING(BillingCountry) grpCty, COUNT(id) accts FROM Account GROUP BY CUBE(Type, BillingCountry) ORDER BY GROUPING(Type), GROUPING(BillingCountry)
SELECT HOUR_IN_DAY(convertTimezone(CreatedDate)), SUM(Amount) FROM Opportunity GROUP BY HOUR_IN_DAY(convertTimezone(CreatedDate))
SELECT Id FROM Opportunity WHERE Amount > USD5000
SELECT Id FROM Opportunity WHERE Amount > USD5000.01
SELECT Id, Amount FROM Opportunity WHERE Amount IN (usd500.01, usd600)
SELECT Name, COUNT(Id) FROM Account GROUP BY Name HAVING COUNT(Id) > 0 AND (Name LIKE '%testing%' OR Name LIKE '%123%')
SELECT Name, COUNT(Id) FROM Account GROUP BY Name HAVING COUNT(Id) > 0 AND (Name IN ('4/30 testing account', 'amendment quote doc testing', null))
SELECT Name, COUNT(Id) FROM Account GROUP BY Name HAVING COUNT(Id) > 0 AND (NOT Name IN ('4/30 testing account', 'amendment quote doc testing'))
SELECT Name, Location__c FROM Warehouse__c WHERE DISTANCE(Location__c, GEOLOCATION(37.775, -122.418), 'mi') < 20
SELECT Name, StreetAddress__c FROM Warehouse__c WHERE DISTANCE(Location__c, GEOLOCATION(37.775, -122.418), 'mi') < 20 ORDER BY DISTANCE(Location__c, GEOLOCATION(37.775, -122.418), 'mi') DESC LIMIT 10
SELECT Id, Name, Location, DISTANCE(Location, GEOLOCATION(10, 10), 'mi') FROM CONTACT
SELECT BillingState, BillingStreet, COUNT(Id) FROM Account GROUP BY BillingState, BillingStreet
SELECT Id, Name, Location__c, DISTANCE(Location__c, GEOLOCATION(-10.775, -10.775), 'MI') FROM CONTACT
SELECT Id FROM Account WHERE CreatedDate IN (TODAY)
SELECT Id FROM Account WHERE CreatedDate IN (TODAY)
SELECT Id FROM Account WHERE CreatedDate IN (TODAY, LAST_N_DAYS:4)
SELECT Id FROM Account WHERE CreatedDate IN (LAST_N_DAYS:2)
SELECT Id FROM Account WHERE CreatedDate IN (LAST_N_DAYS:4, LAST_N_DAYS:7)
SELECT SBQQ__Product__r.Name foo, SBQQ__Quote__c foo1 FROM SBQQ__Quoteline__c GROUP BY SBQQ__Quote__c, SBQQ__Product__r.Name
SELECT Id, convertCurrency(Amount) FROM Opportunity WHERE Amount > 0 AND CALENDAR_YEAR(CloseDate) = 2020
SELECT Id FROM LoginHistory WHERE LoginTime > 2020-04-23T09:00:00.00000000000000000000000000000000+00:00 AND LoginTime < 2020-04-15T02:40:03.000+0000
SELECT ProductCode FROM Product2 GROUP BY ProductCode HAVING COUNT(Id) > 1 ORDER BY COUNT(Id) DESC
SELECT AnnualRevenue FROM Account WHERE NOT (AnnualRevenue > 0 AND AnnualRevenue < 200000)
SELECT AnnualRevenue FROM Account WHERE ((NOT AnnualRevenue > 0) AND AnnualRevenue < 200000)
SELECT Id FROM Account WHERE NOT Id = '2'
SELECT WEEK_IN_YEAR(CloseDate), SUM(amount) FROM Opportunity GROUP BY WEEK_IN_YEAR(CloseDate) ORDER BY WEEK_IN_YEAR(CloseDate)
SELECT WEEK_IN_YEAR(CloseDate), SUM(amount) FROM Opportunity GROUP BY WEEK_IN_YEAR(CloseDate) ORDER BY WEEK_IN_YEAR(CloseDate) DESC NULLS FIRST
SELECT WEEK_IN_YEAR(CloseDate), SUM(amount) FROM Opportunity GROUP BY WEEK_IN_YEAR(CloseDate) ORDER BY WEEK_IN_YEAR(CloseDate) DESC NULLS LAST, SUM(amount) ASC NULLS LAST
SELECT FIELDS(ALL) FROM Account
SELECT FIELDS(CUSTOM), FIELDS(STANDARD) FROM Account
SELECT Id, (SELECT FIELDS(ALL) FROM Contacts) FROM Account
SELECT UserId, CALENDAR_MONTH(LoginTime) month FROM LoginHistory WHERE NetworkId != NULL GROUP BY UserId, CALENDAR_MONTH(LoginTime)
SELECT Id, (SELECT Id FROM Contacts WHERE Id IN :contactMap.keySet()) FROM Account WHERE Id IN :accountMap.keySet()
SELECT Id, (SELECT Id FROM Contacts WHERE Id IN :contact_900Map.keySet()) FROM Account WHERE Id IN :acco INVALID untMap.keySet()
SELECT Id FROM Account WHERE Id IN :new Map<Id, SObject>(someVar).keySet()
SELECT Id FROM Account WHERE Id IN :new Map<Id, SObject>(someVar).getSomeClass().records
SELECT Id FROM SBQQ__QuoteTerm__c WHERE SBQQ__StandardTerm__c = :CPQ_Hard_Coded_Ids__c.getInstance().Standard_Quote_Term_Id__c
SELECT Id FROM Opportunity WHERE SBQQ__StandardTerm__c = :quotes[3].SBQQ__QuoteLine__r[0].Term__c
SELECT Name FROM Account WHERE Name IN ('GenePoint\'s \n Ok!?!@#$^%$&*()_+')
SELECT State_Abbr_c FROM Contact WHERE State_Abbr_c = 'MI' OR State_Abbr_c = 'km'
SELECT State_Abbr_c FROM Contact WHERE State_Abbr_c = 'KM'
SELECT State_Abbr_c FROM Contact WHERE State_Abbr_c IN ('mi', 'KM')
SELECT LeadSource, COUNT(Name) FROM Lead GROUP BY LeadSource HAVING COUNT(Name) > 100 AND LeadSource > 'km'
SELECT Id FROM Account WITH USER_MODE
SELECT Id FROM Account WITH SYSTEM_MODE
SELECT Id, BillingCity FROM Account WHERE NOT (NOT BillingCity LIKE '%123%')
SELECT Id FROM Account WHERE NOT (NOT Invoice_Type__c LIKE '%Usage%')
SELECT Id FROM Account WHERE (NOT Invoice_Type__c LIKE '%Usage%')
SELECT Id, City FROM Lead WHERE NOT ((NOT (City LIKE '%LHR%')) AND City LIKE '%KHR%')
SELECT Name FROM Invoice__c WHERE Balance__c < USD-500