Min and Max are inversed in MySQL -
i don't know why have when try min , max receive wrong response!
here content date :
and here mysql request :
select min(`value`),max(`value`) weather_data `date`="2015-10-22" , `type`="temperature"
but response of mysql request :
do have idea of why have response?
it looks value
represented string. so, happily, min()
, max()
working correctly.
if values can converted on system, can use:
select min(`value` + 0), max(`value` + 0) weather_data `date` = '2015-10-22' , `type` = 'temperature';
the +
silent conversion. if min , max both return 0, commas not recognized, replace them periods:
select min(replace(`value`, ',', '.') + 0), max(replace(`value`, ',', '.') + 0) weather_data `date` = '2015-10-22' , `type` = 'temperature';
Comments
Post a Comment