- Documentation
- Installation
- Data Import
- Client APIs
- SQL
- Introduction
- Statements
- Overview
- Select
- Insert
- Delete
- Update
- Create Schema
- Create Table
- Create View
- Create Sequence
- Create Macro
- Drop
- Alter Table
- Copy
- Export
- Query Syntax
- Data Types
- Expressions
- Functions
- Overview
- Numeric Functions
- Text Functions
- Pattern Matching
- Date Functions
- Timestamp Functions
- Time Functions
- Interval Functions
- Date Formats
- Date Parts
- Blob Functions
- Nested Functions
- Indexes
- Aggregates
- Window Functions
- Samples
- Configuration
- Pragmas
- Development
- Sitemap
- Why DuckDB
- FAQ
- Code of Conduct
- Live Demo
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
-- select all rows that have id equal to 3
SELECT *
FROM table_name
WHERE id=3;
-- select all rows that match the given case-insensitive LIKE expression
SELECT *
FROM table_name
WHERE name ILIKE '%mark%';
-- select all rows that match the given composite expression
SELECT *
FROM table_name
WHERE id=3 OR id=7;
Syntax
Search Shortcut cmd + k | ctrl + k