Jump to: navigation, search

Mysql OPERATOR GREATER THAN

From w3cyberlearnings

Contents

MySQL Greater Than

This operator checks the value for greater than.

Syntax

N is a number to check for greater than M.

 N > M;

Example 1


mysql> SELECT 3 > 2, 3 > 4;
+-------+-------+
| 3 > 2 | 3 > 4 |
+-------+-------+
|     1 |     0 | 
+-------+-------+
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 |
+----+------------+-------------+
|  2 |         40 |          50 | 
|  4 |         34 |          90 | 
+----+------------+-------------+
2 rows in set (0.01 sec)


Related Links



Navigation
Web
SQL
MISC
References