And Or : AND « Function « SQL / MySQL






And Or

   
mysql>
mysql> SELECT 1 AND 0;
+---------+
| 1 AND 0 |
+---------+
|       0 |
+---------+
1 row in set (0.00 sec)

mysql>
mysql> SELECT NOT(1 AND 0);
+--------------+
| NOT(1 AND 0) |
+--------------+
|            1 |
+--------------+
1 row in set (0.00 sec)

mysql>
mysql> SELECT !((1 OR 0) AND (0 OR 1));
+--------------------------+
| !((1 OR 0) AND (0 OR 1)) |
+--------------------------+
|                        0 |
+--------------------------+
1 row in set (0.00 sec)

mysql>

   
    
    
  








Related examples in the same category

1.Use the bitwise AND (&) operator to manipulate the bit values.