Jump to: navigation, search

Mysql OPERATOR EQUAL

From w3cyberlearnings

Contents

MySQL Equal

This operator performs an equality comparison.

Syntax

N1 = N2;

Example 1

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

Example 2

mysql> SELECT * FROM totalearn;
+----+------------+-------------+
| id | total_hour | hourly_rate |
+----+------------+-------------+
|  1 |         30 |          50 | 
|  2 |         40 |          50 | 
|  3 |         30 |          80 | 
|  4 |         34 |          90 | 
+----+------------+-------------+
4 rows in set (0.00 sec)

mysql> SELECT * FROM totalearn
    -> WHERE total_hour=30;
+----+------------+-------------+
| id | total_hour | hourly_rate |
+----+------------+-------------+
|  1 |         30 |          50 | 
|  3 |         30 |          80 | 
+----+------------+-------------+
2 rows in set (0.00 sec)


Related Links



Navigation
Web
SQL
MISC
References