WordPress
- 5 ответов
- 0 вопросов
2
Вклад в тег
SELECT T1.tel_id, T1.sum1, T2.sum2
FROM
(SELECT tel_id, sum(money) AS sum1
FROM accounts
WHERE date >= CURDATE() AND tel_id = 1234 AND type = 1 AND status = 1
) T1,
(SELECT tel_id, sum(money) AS sum2
FROM accounts
WHERE date >= CURDATE() AND tel_id IN (1542, 6624, 2524) AND type = 1 AND status = 1
) T2
WHERE T2.tel_id = T1.tel_id