Help Center/
Data Lake Insight/
SQL Syntax Reference (Paris Region)/
Spark SQL Syntax Reference/
Filtering/
WHERE Filtering Clause
Updated on 2022-12-07 GMT+08:00
WHERE Filtering Clause
Function
This statement is used to filter the query results using the WHERE clause.
Syntax
1 2 |
SELECT [ALL | DISTINCT] attr_expr_list FROM table_reference WHERE where_condition; |
Keyword
- All is used to return repeated rows. By default, all repeated rows are returned. It is followed by asterisks (*) only. Otherwise, an error will occur.
- DISTINCT is used to remove the repeated line from the result.
- WHERE is used to filter out records that do not meet the condition and return records that meet the condition.
Precautions
The to-be-queried table must exist.
Example
To filter the records in which the scores are higher than 90 and lower than 95 in the student table, run the following statement:
1 2 |
SELECT * FROM student WHERE score > 90 AND score < 95; |
Parent topic: Filtering
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot