Mysql select concat (charfield, format (doublefield, 8)) gives error 1267
which is ironic on two points, 1) since concat (charfield, doublefield) works (it doesn't matter when one of the fields to be concatenated is numeric) and 2) because the mysql link shows this: CONCAT (str1, str2, .. .) as a prototype for CONCAT and FORMAT: "FORMAT (X, D) Formats number X in format like" #, ###, ###. ## ", rounded to D decimal places and returns the result as a string .
Desperate I tried select concat(symbol, cast(format(closeprice,8) as char))
which worked. So you might be thinking, "Why is this guy wasting our time, he found something that works," which is true. But it doesn't make sense to me and so I was wondering if someone could clarify it?
+2
source to share
3 answers