[string] [float] string to float en sql
Bonjour,
J'ai une petite question.
Je voulais savoir dans quelle base de données on peut caster un string en float.
Car en ce moment, j'utilise mysql et je n'y arrive pas.
la fonction cast("1,23" AS FLOAT) ne s'execute pas.
En résumé je voudrais savoir si il était possible de faire la conversion string to float sur mysql ?
Et si non quelle base le permet ?
Merci d'avance.
@++
Re: [string] [float] string to float en sql
Citation:
Envoyé par chickenhuchette
En résumé je voudrais savoir si il était possible de faire la conversion string to float sur mysql ?
Apparemment pas :
Citation:
CAST(expr AS type) , CONVERT(expr,type) , CONVERT(expr USING transcoding_name)
The CAST() and CONVERT() functions can be used to take a value of one type and produce a value of another type.
The type can be one of the following values:
* BINARY
* CHAR
* DATE
* DATETIME
* SIGNED [INTEGER]
* TIME
* UNSIGNED [INTEGER]
Essaie peut-être comme ça :
Code:
SELECT '1.23' + 0.0
mais je n'y crois pas trop...
[edit] en fait si ça fonctionne ;) [/edit]