Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

JOIN Multiple Select Statements as tables

SELECT t1.ks, t1.[# Tasks], COALESCE(t2.[# Late], 0) AS [# Late]
FROM 
    (SELECT ks, COUNT(*) AS '# Tasks' FROM Table GROUP BY ks) t1
LEFT JOIN
    (SELECT ks, COUNT(*) AS '# Late' FROM Table WHERE Age > Palt GROUP BY ks) t2
ON (t1.ks = t2.ks);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #JOIN #Multiple #Select #Statements #tables
ADD COMMENT
Topic
Name
6+4 =