I am looking for some function that will return the type of given value/result like TYPE(value)
. Similar as for charset/collation for which there are functions CHARSET(value)
//COLLATION(VALUE)
.
I know how to query a column type. But I am looking really for a function applicable to any value/result:
-
select CONCAT('hello', 5)
-
select IF(1, 'hello', 5) as v1, IF(0, 'hello', 5) as v2
-
(select 'hello' AS v) union all (select '5')
-
select 4.0 AS v
Does MySQL have any function to display the type?
Best Answer
A partial answer:
Note the extra parameters. Now I will issue just one simple command; see what it comes back with:
I don't think there is a way to get the 'type' of an expression.