BILLmanager and number of VDS templates

SELECT p.id, p.name, COUNT(dp.diskimage) AS templates
FROM pricelist p
LEFT JOIN diskimage2pricelist dp
ON p.id=dp.pricelist
WHERE p.type=6
GROUP BY dp.pricelist;
 
+-----+--------------------------------------+-----------+
| id  | name                                 | templates |
+-----+--------------------------------------+-----------+
|  63 | Сервер VDS1 (Базовый)                |        65 |
|  64 | Сервер VDS2 (Стандарт)               |        65 |
|  65 | Сервер VDS3 (Эксперт)                |        65 |
|  66 | Сервер VDS4 (Бизнес)                 |        65 |
|  95 | Сервер VBX1 (Базовый)                |         2 |
|  99 | Сервер VBX2 (Стандарт)               |         2 |
| 103 | Сервер VBX3 (Эксперт)                |         2 |
| 107 | Сервер VBX4 (Бизнес)                 |         2 |
+-----+--------------------------------------+-----------+
8 rows in set (0.00 sec)

Leave a Reply

Your email address will not be published. Required fields are marked *