MySQL MAX and MIN function return unexpected values -


i use sql request :

select max(valeur), min(valeur) liste_caracteristiques l idcarac = '1' 

idcarac = 1 weight of product, use join, explain problem simplified query

on table :

|idcarac|int(11) |refproduit|int(11) |valeur|varchar(255)  |1|8957|3 |1|9980|1200 |2|8957|8.3cm |2|9980|15cm 

the result : max(valeur) = 3 , min(valeur) = 1200

and can't understand why

e : max value minimal value, , minimal value maximal value

try casting values of valeur

select max(cast (valeur int)), min(cast (valeur int))  liste_caracteristiques l  idcarac = '1' 

Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -