Answering the question below, I found that this construct CAST(SUM(CASE
WHEN t1.data IS NOT NULL THEN 1
ELSE 0
END
) AS FLOAT) * 100 / COUNT(*) AS "% collected" works on MySQL 8 (5.7 run failed) but not on 5.6. Works on MariaDB 10.3, .4 & .5 and also on PostgreSQL (all versions AFAICS... any ideas as to why it won't work on 5.6 - any workarounds?