The AND construct means that both clauses must be true. : And « Where Clause « SQL / MySQL






The AND construct means that both clauses must be true.

       
mysql>
mysql> CREATE TABLE sales_rep(
    ->   employee_number INT,
    ->   surname VARCHAR(40),
    ->   first_name VARCHAR(30),
    ->   commission TINYINT
    -> );
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql>
mysql>
mysql> SELECT * FROM sales_rep WHERE surname='Rive' AND (first_name='Sol' OR commission>10);
Empty set (0.00 sec)

mysql>
mysql> drop table sales_rep;
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql>

   
    
    
    
    
    
    
  








Related examples in the same category

1.Combine conditions
2.Use AND to combine conditions
3.AND and OR may be intermixed
4.Combine conditions in select clause
5.Use AND for int value
6.Define multiple conditions in a clause
7.To display the author who painted each book
8.retrieve the name of the customer placing order 4
9.Put the entire original expression in parentheses and negate the whole thing with NOT
10.Compare two conditions
11.And 1