How can I run these queries as a single query?
SELECT count(url) as t1 from shop_links
and
SELECT count(url) as t2 from shop_links where status = 3
I would like t1 and t2 in the end
>Solution :
SELECT
COUNT(url) AS t1,
COUNT(IF(status = 3, 1, NULL)) AS t2
FROM shop_links
If records status is 3, the IF will return value for COUNT() to count, if it is not 3 it returns NULL with COUNT will skip counting that record