Mysql
 sql >> Datenbank >  >> RDS >> Mysql

Wie vergleicht man wissenschaftliche Notation und Dezimalzahlen in der Aggregatfunktion mysql MIN()?

Umwandlung in Dezimalzahl sollte helfen :-

mysql> select cast( "5.89872212195226e-05"  as decimal(65,30));
+--------------------------------------------------+
| cast( "5.89872212195226e-05"  as decimal(65,30)) |
+--------------------------------------------------+
|                 0.000058987221219522600000000000 |
+--------------------------------------------------+

Vergleichsbeispiel :-

mysql> select least( 4, cast("5.89872212195226e-05" as decimal(65,30)) );
+------------------------------------------------------------+
| least( 4, cast("5.89872212195226e-05" as decimal(65,30)) ) |
+------------------------------------------------------------+
|                           0.000058987221219522600000000000 |
+------------------------------------------------------------+

Beispielverwendung :-

MIN(cast( ...  as decimal(65,30)))