MySQL Tutorials - Herong's Tutorial Examples - v4.46, by Herong Yang
WHERE Clause of a SELECT Statement
This section provides tutorial examples on how to use the WHERE clause to filter rows out of the base table in a SELECT statement.
As I mentioned earlier, the WHERE clause modifies the base table by filtering out rows of data that do not satisfy the specified conditions. Here is its syntax:
WHERE where_condition
where "where_condition" is a predicate operation that will result a true or false condition.
WHERE clause samples:
WHERE Salary <= 45000.00 WHERE Salary > 45000.00 AND Salary <= 65000.00 WHERE Dept IN ('Math','Chem') WHERE (Dept = 'Math' OR Dept = 'Chem') AND Salary <= 45000.00 WHERE User.Dept_ID = Dept.ID
Table of Contents
MySQL Introduction and Installation
Introduction of MySQL Programs
Perl Programs and MySQL Servers
Java Programs and MySQL Servers
Character Strings and Bit Strings
Table Column Types for Different Types of Values
Using DDL to Create Tables and Indexes
Using DML to Insert, Update and Delete Records
►Using SELECT to Query Database
FROM Clause of a SELECT Statement
JOIN - Operation to Join Two Tables
JoinTable.sql - Example of Join Tables
►WHERE Clause of a SELECT Statement
ORDER BY Clause of a SELECT Statement
GROUP BY Clause of a SELECT Statement
Window Functions for Statistical Analysis
Use Index for Better Performance
Transaction Management and Isolation Levels
Defining and Calling Stored Procedures
Variables, Loops and Cursors Used in Stored Procedures
System, User-Defined and Stored Procedure Variables
Storage Engines in MySQL Server
InnoDB Storage Engine - Primary and Secondary Indexes
Performance Tuning and Optimization
Installing MySQL Server on Linux