Tuesday, 2 August 2016

GREATEST: Get greatest element from list of elements



mysql> SELECT GREATEST(2, 4, 32, 54, 321, 87, 98);
+-------------------------------------+
| GREATEST(2, 4, 32, 54, 321, 87, 98) |
+-------------------------------------+
|                                 321 |
+-------------------------------------+
1 row in set (0.01 sec)


mysql> SELECT GREATEST('apples', 'applis', 'applas');
+----------------------------------------+
| GREATEST('apples', 'applis', 'applas') |
+----------------------------------------+
| applis                                 |
+----------------------------------------+
1 row in set (0.01 sec)







Previous                                                 Next                                                 Home

No comments:

Post a Comment