SELECT CYear AS Date,
(SELECT COUNT(*) FROM COMPANIES WHERE (YEAR(reg_date) = CY.CYear)) AS opened_count,
(SELECT COUNT(*) FROM COMPANIES WHERE (YEAR(terminate_date) = CY.CYear)) AS terminate_count
FROM (
SELECT YEAR(C1.reg_date) AS CYear
FROM COMPANIES AS C1
WHERE (NOT (C1.reg_date IS NULL))
UNION
SELECT YEAR(C2.terminate_date) AS CYear
FROM COMPANIES AS C2
WHERE (NOT (C2.terminate_date IS NULL))) AS CY
Что должен знать junior php на 2020
девушки которая ушла
28 слишком стар
Посоветуйте, что изучать для трудоустройства или выхода на фриланс?