MySQL SQLLesson 7Free preview
MySQL WHERE
This lesson is part of MySQL · All levels
Summary
The WHERE clause is used to filter the row to only meet certain conditions that are involved in the processing. The condition can compare the column with a fixed value or the result of a function, e.g. price > 10000 or date_list >= '2024-01-01'. In MySQL, a string is enclosed with a single quotation mark, whereas a double quotation mark is only used for identifiers such as a special table or column name.
Key points
- WHERE is placed after FROM and before ORDER BY or LIMIT
- Common comparison operators: =, <>, >, <, >=, <=
- The value text and date must be enclosed with a single quotation mark
- Row with value NULL cannot be compared using = and should be checked with IS NULL
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.