21
loading...
This website collects cookies to deliver better user experience
SELECT * FROM table WHERE condition;
SELECT DISTINCT f1, f2 FROM table
WHERE condition ORDER BY f2 DESC;
SELECT QUANTITY (*) FROM table;
SELECT COUNT(*) FROM (SELECT DISTINCT f1 FROM table WHERE condition);
SELECT smth FROM table
WHERE EXISTS (SELECT * FROM table2 WHERE table2.field = table.field1);
SELECT field1 as f1, field2 as f2
FROM table AS first_table
WHERE EXISTS
(SELECT * FROM table2 AS second_table
WHERE second_table.field = first_table.f1);
SELECT field, COUNT(*) FROM table
WHERE condition GROUP BY field HAVING having_condition;
SELECT column_name(s) FROM table1
UNION (UNION ALL)
SELECT column_name(s) FROM table2
INSERT INTO table_name values (v1, v2, …);
INSERT INTO table_name (col1, col2) VALUES (v1, v2);
UPDATE table_name SET col1 = val1, col2 = val2 WHERE condition;
DELETE FROM table_name WHERE condition;