1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
SELECT c.id, c.name, c.slug, c.ckey,
COUNT(DISTINCT P.id) AS n_project,
SUM(F.size) AS ClientDisk
FROM Clients C
INNER JOIN Projects P
ON P.client_id = C.Id
LEFT JOIN Files F
ON F.project_id = P.id
RIGHT OUTER JOIN Projects
ON C.id = projects.client_id
GROUP BY c.id, c.name, c.slug, c.ckey
SELECT c.id, c.name, c.slug, c.ckey,
COUNT(DISTINCT P.id) AS n_project,
SUM(F.size) AS ClientDisk
FROM Clients C
INNER JOIN Projects P
ON P.client_id = C.Id
LEFT JOIN Files F
ON F.project_id = P.id
LEFT OUTER JOIN Projects
ON projects.client_id = C.id
GROUP BY c.id, c.name, c.slug, c.ckey
SELECT c.id, c.name, c.slug, c.ckey,
COUNT(DISTINCT P.id) AS n_project,
SUM(F.size) AS ClientDisk
FROM Clients C
INNER JOIN Projects P
ON P.client_id = C.Id
LEFT JOIN Files F
ON F.project_id = P.id
LEFT JOIN Projects
ON projects.client_id = C.id
GROUP BY c.id, c.name, c.slug, c.ckey
ETC... |
Partager