Mysql, I am using SQL_CALC_FOUND_ROWS to get the total number of possible records.
How do I use it on UNION?
The only thing that works for me right now, which seems somewhat off is:
SELECT COUNT(*)
FROM(SELECT * FROM t1 UNION SELECT * FROM t2) A;
or
SELECT SQL_CALC_FOUND_ROWS *
FROM(SELECT * FROM t1 UNION SELECT * FROM t2) A;
From the FOUND_ROWS() documentation: