0%

SQL: 筛选出来的两个SQL表如何join

SQL: 筛选出来的两个SQL表如何join?

筛选出来的两个SQL表需要用小括号

SELECT 
* 
FROM
(SELECT ks, COUNT(*) AS '# Tasks' FROM Table GROUP BY ks) t1 
INNER JOIN
(SELECT ks, COUNT(*) AS '# Late' FROM Table WHERE Age > Palt GROUP BY ks) t2
ON t1.ks = t2.ks

原文博主: 热衷开源的宝藏Boy
原文链接: http://www.fangzengye.com/article/1626952006
版权声明: 自由转载-非商用-禁止演绎-保持署名| CC BY-NC-ND 3.0

评论区