How do I convert boolean to integer in a MySQL query. I have tried numerous, things and have come up empty. I'm simply looking to convert the "value" column of true/false to 1 and 0 respectively into the "finalvalue" column. Please see link of screenshot.
MySQL Query:
SELECT
UNIX_TIMESTAMP(timestamp) as time_sec,
topic as metric,
data as value,
cast(DATA AS SIGNED) as finalvalue
FROM tcl_mqtt_log
WHERE topic = 'jace/home/heatpump/uvlight_ss';