Salesforce · SOQL

Visual SOQL Query Builder

Build Salesforce Object Query Language queries without memorising syntax. Choose your object, pick fields, set filters, and copy ready-to-run SOQL.

1 · Choose object
2 · Select fields
3 · Filter (WHERE)
4 · Sort & limit
Generated SOQL

        

What is SOQL?

SOQL (Salesforce Object Query Language) is Salesforce's query language for retrieving data from the database. It's similar to SQL but designed around Salesforce's object model. Every Apex class, flow, or integration that reads Salesforce data uses SOQL under the hood.

A basic SOQL query looks like: SELECT Id, Name, Email FROM Contact WHERE AccountId = '001...' LIMIT 200

SOQL vs SQL — key differences

SOQL only supports SELECT — no INSERT, UPDATE, DELETE (those are handled by DML statements in Apex). There's no JOIN keyword — you navigate relationships using dot notation: Account.Name on Contact. Parent-to-child relationships use subqueries: SELECT Id, (SELECT Id FROM Contacts) FROM Account. SOQL has governor limits: 100 queries per synchronous transaction, 50,000 rows total returned. Wildcards (SELECT *) are not supported — you must list every field explicitly. LIKE uses % as wildcard: Name LIKE 'Acme%'.

SOQL governor limits to know

100 SOQL queries per synchronous Apex transaction (200 in async/batch). 50,000 rows total returned per transaction. LIMIT 2000 maximum per query (use OFFSET for pagination, but OFFSET max is 2000). For large data volumes, use Batch Apex or the Bulk API instead of SOQL in loops. Never put SOQL inside a for loop — "SOQL in loops" is the most common Salesforce anti-pattern.

Useful SOQL features this builder doesn't cover yet

Aggregate functions: COUNT(), SUM(), MIN(), MAX(), AVG() with GROUP BY. Date literals: LAST_N_DAYS:30, THIS_QUARTER, LAST_YEAR — extremely useful for date filtering. Semi-joins: WHERE Id IN (SELECT AccountId FROM Contact WHERE ...). WITH SECURITY_ENFORCED: enforces field and object-level security automatically.

Building something on Salesforce?

We specialise in Salesforce implementations, custom Apex, integrations, and AI-powered RevOps solutions.

Let's talk →