I'm trying to grab 2 count values from a union all query and then combine the sum of those 2 values so i then have a total count. The query at the moment is giving me 2 rows of data which is 1 for each of the queries.
How can i update the below query to only display 1 row with the total count of the 2 queries.
SELECT SUM(qty) as qty
FROM (
SELECT COUNT(f.unread) as qty
FROM users u, followers f
WHERE u.uid = f.follower AND f.uid = '605bb0e3d8fb16.55214369' AND f.unread = 'Y' GROUP BY f.unread
UNION ALL
SELECT COUNT(f.unread) as qty
FROM users u, comments f, subs s
WHERE u.uid = f.uid AND s.sid = f.sid AND s.uid = '605bb0e3d8fb16.55214369' AND f.uid <> '605bb0e3d8fb16.55214369' AND f.unread = 'Y' GROUP BY f.unread
) t
GROUP BY t.qty
Thanks in advance