【发布时间】:2022-08-04 14:22:55
【问题描述】:
如何将这些查询作为单个查询运行?
SELECT count(url) as t1 from shop_links
和
SELECT count(url) as t2 from shop_links where status = 3
最后我想要 t1 和 t2
标签: mysql
如何将这些查询作为单个查询运行?
SELECT count(url) as t1 from shop_links
和
SELECT count(url) as t2 from shop_links where status = 3
最后我想要 t1 和 t2
标签: mysql
请这样做
SELECT ((SELECT count(url) as t1 from shop_links) + (SELECT count(url) as t2 from shop_links where status = 3 )) AS count
【讨论】: