MySQL Forums
Forum List  »  Italian

Operatori matematici su campi testo
Posted by: vera falsona
Date: September 10, 2015 06:33AM

Buongiorno a tutti, ho un semplice db di test con un campo text, dove inserirĂ² dei valori numerici comprensivi di segno +/- e . come separatore dei decimali. Per motivi personali non voglio usare un campo float o double. Gli operatori matematici come funzionano in questo caso? Se ad esempio volessi ottenere solo la parte intera dopo un'operazione SUM potrei incontrare dei problemi?
Ho notato che per quanto concerne l'ordinamento dei record ottengo due risultati diversi con queste due query:
ORDER BY testo ASC
ORDER BY CAST(test as SIGNED) ASC
Mi potete spiegare come mai?

Grazie a tutti e buona giornata.

Vera.

Options: ReplyQuote


Subject
Views
Written By
Posted
Operatori matematici su campi testo
1667
September 10, 2015 06:33AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.