Ragazzi utilizzo mysql e mi succede una cosa strana :
ho una tabella con
perchè quando voglio fare la select per prendere il valore massimo mi prelevacodice:mytab camp1 cmp2 val(float) cmp3 mydatatime 7 2 12312 8 '2012-10-25 12:03:00' 7 2 1.1245e+06 8 '2012-10-25 12:40:00'
1.1245e+06 e non 12312 ? come posso fare per eliminare questo problema ?
Grazie
Ecco la select :
NB.: La select mi prende i dati del giorno precedente che comunque non fa testo sul problema che ho.codice:select distinct `cmp1`, `cmp2`, max(`val`) AS `valmax`, `cmp3`, `mydatatime` from `mytab` where ((`cmp3` = 8) and ((to_days(now()) - to_days(`mydatetime`)) = 1)) group by `cmp1 , `cmp2' , `cmp3' , year(`mydatetime`) , month(`mydatetime`) , dayofmonth(`mydatetime`) order by `cmp1` , `cmp2` , max(`mydatetime`)
Grazie

Rispondi quotando