Definition:
The AND clause extends SELECT, DELETE, or UPDATE statements by adding one or more conditions to the statement. For example, this SQL SELECTS all of the users in the users table who have the first name 'john':
SELECT * FROM users
WHERE first_name = 'john';
By adding an AND clause, the SELECT statement can be made more selective:
SELECT * FROM users
WHERE first_name = 'john'
AND city = 'seattle';
This statement returns only those users whose first name is 'john' and whose city is listed as 'seattle';
Multiple AND statements may be used, adding as many conditions as needed:
SELECT * FROM users
WHERE first_name = 'john'
AND city = 'seattle'
AND state = 'washington'
AND zipcode = '98111';
Related Code Snippets:
- Alias and RowType - This block finds all employees whose monthly wages (salary plus commission) ar...
