⌘+k ctrl+k
1.1.3 (stable)
Search Shortcut cmd + k | ctrl + k
WHERE Clause

The WHERE clause specifies any filters to apply to the data. This allows you to select only a subset of the data in which you are interested. Logically the WHERE clause is applied immediately after the FROM clause.

Examples

选择所有id等于3的行:

SELECT *
FROM table_name
WHERE id = 3;

选择所有匹配给定区分大小写LIKE表达式的行:

SELECT *
FROM table_name
WHERE name LIKE '%mark%';

选择所有与给定的不区分大小写表达式匹配的行,该表达式使用ILIKE操作符制定:

SELECT *
FROM table_name
WHERE name ILIKE '%mark%';

选择所有匹配给定复合表达式的行:

SELECT *
FROM table_name
WHERE id = 3 OR id = 7;

Syntax