SQL SELECT Queries
Core SELECT query clauses — SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT. This category documents 46 SQL select queries entries, and each page gives you the full syntax, the parameter list, the return value, and a runnable example tested against MySQL, PostgreSQL, SQL Server, and SQLite. The entries are: SELECT, SELECT *, SELECT DISTINCT, WHERE, AND / OR / NOT, IN, BETWEEN, LIKE, IS NULL / IS NOT NULL, ORDER BY, LIMIT / OFFSET, GROUP BY, HAVING, CASE, COALESCE, NULLIF, FETCH FIRST / FETCH NEXT, SELECT TOP, SELECT INTO, FOR UPDATE, TABLESAMPLE, PIVOT, OFFSET ... FETCH (SQL Standard), OUTPUT (SQL Server) / RETURNING, Year-over-Year Comparison, Query Hints (Optimizer), Histogram (Data Distribution), WITH TIES (SQL Standard), SYSTEM$CLUSTER_DELAY / SYSTEM$TYPEOF (Snowflake), SQL Execution Order, SQL Injection Prevention, SQL WILDCARD Characters, SQL HELLO WORLD, SQL COMMENTS, SQL NORMALIZATION (1NF, 2NF, 3NF), ROWNUMBER Pagination Pattern, EXPLAIN Output Analysis, N+1 Query Problem, MySQL vs PostgreSQL: Key Differences, SQL-92 vs SQL:2016 Features, and more. Not sure where to start? SELECT and SELECT * are the most commonly used entries in this category. You can also search across every category from the search page, browse the complete A–Z index, or try any of these statements live in the SQL playground.