我有以下联合查询,联合的第一部分返回 8,第二部分返回 1。我想知道如何合并总数,所以结果是 9。
这是查询
SELECT COUNT(*)
FROM media
LEFT JOIN users ON users.id = media.userId
WHERE media.title LIKE '%braydo25%' OR media.description LIKE '%braydo25%' OR media.tags LIKE '%braydo25%' OR users.username LIKE 'braydo25'
UNION ALL
SELECT COUNT(*)
FROM reposts
LEFT JOIN media ON media.id = reposts.mediaId
LEFT JOIN users ON users.id = reposts.userId
WHERE media.title LIKE '%braydo25%' OR media.description LIKE '%braydo25%' OR media.tags LIKE '%braydo25%' OR users.username LIKE 'braydo25'