See below query. I want to get the size of the table returned in the sub query but the .size does not work. Is there a way around this?
SELECT
(SELECT
ROUND(AVG(ts.data / ts.avglen), 0) AS 'size'
FROM
x.ddp_table_stats AS ts, x.ddp_table_names AS tn
WHERE
ts.tableid = tn.id
AND ts.date = '2017-12-21'
AND tn.name IN ('nic_stat' , 'agent_app_names')
GROUP BY name).size -
(SELECT
ROUND(AVG(ts.data / ts.avglen), 0) AS 'size'
FROM
x.ddp_table_stats AS ts, x.ddp_table_names AS tn
WHERE
ts.tableid = tn.id
AND ts.date = '2017-12-19'
AND tn.name IN ('nic_stat' , 'agent_app_names')
GROUP BY name).size AS result;