Doris Simple Queries (WHERE clauses, IN clauses, LIKE operations, etc.)
Doris is a distributed database system that supports various simple query methods. Here is an introduction to simple queries in Doris:
WHERE clause
The WHERE clause is used to filter data, thereby obtaining a dataset that meets the specified conditions.
For example: SELECT * FROM users WHERE age > 18
Using conditions
Use conditions to filter data, such as:
- Equal to (=)
- Not equal to (≠)
- Greater than (>)
- Less than (<)
- Greater than or equal to (>=)
- Less than or equal to (<=)
Using operators
Use operators to compare column values, such as:
- And (AND)
- Or (OR)
- Not (NOT)
IN clause
The IN clause is used to match data against a list of given values.
For example: SELECT * FROM users WHERE department IN (Sales, Marketing)
Using the IN clause
Use the IN clause to filter data, such as:
- Equal to (=)
- Not equal to (≠)
- Greater than (>)
- Less than (<)
- Greater than or equal to (>=)
- Less than or equal to (<=)
LIKE operation
The LIKE operation is used to match patterns in column values.
For example: SELECT * FROM users WHERE name LIKE '%John%'
Using the LIKE operation
Use the LIKE operation to filter data, such as:
- Equal to (=)
- Not equal to (≠)
- Greater than (>)
- Less than (<)
- Greater than or equal to (>=)
- Less than or equal to (<=)
Complex queries
Combining WHERE, IN, and LIKE clauses can perform complex queries.
For example: SELECT * FROM users WHERE age > 18 AND department IN (Sales, Marketing)