mirror of
https://github.com/MariaDB/server.git
synced 2026-05-02 13:15:32 +02:00
A small explanation regarding comparison of ENUM and SET values
This commit is contained in:
parent
9f9522f445
commit
f5c4daf568
1 changed files with 5 additions and 0 deletions
|
|
@ -33868,6 +33868,11 @@ Returns the minimum or maximum value of @code{expr}. @code{MIN()} and
|
||||||
@code{MAX()} may take a string argument; in such cases they return the
|
@code{MAX()} may take a string argument; in such cases they return the
|
||||||
minimum or maximum string value. @xref{MySQL indexes}.
|
minimum or maximum string value. @xref{MySQL indexes}.
|
||||||
|
|
||||||
|
There is one inconsistency in MySQL in handling @code[ENUM] and @code[SET]
|
||||||
|
types when it comes to @code{MIN()}, @code{MAX()} and other aggregating
|
||||||
|
functions. MySQL will compare values based on string values of the columns,
|
||||||
|
instead of it's relative position. This will be fixed in future.
|
||||||
|
|
||||||
@example
|
@example
|
||||||
mysql> SELECT student_name, MIN(test_score), MAX(test_score)
|
mysql> SELECT student_name, MIN(test_score), MAX(test_score)
|
||||||
-> FROM student
|
-> FROM student
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue