Ini pertanyaan Anda:
SELECT c.*, COUNT(d.servername) as servercount, d.controller
FROM customers C JOIN
customerdata d
ON c.id = d.customer
WHERE isVdi = :isVdi AND d.controller = :controller
GROUP BY d.customer
ORDER BY c.name ASC, c.environment ASC;
Sayangnya, apa pun = NULL
tidak akan pernah kembali benar. Sayangnya, MySQL tidak mendukung standar ANSI NULL
-safe comparator is not distinct from
. Tapi dengan senang hati itu memiliki alternatif. Anda dapat mencoba ini:
SELECT c.*, COUNT(d.servername) as servercount, d.controller
FROM customers C JOIN
customerdata d
ON c.id = d.customer
WHERE isVdi = :isVdi AND
d.controller <=> :controller
GROUP BY d.customer
ORDER BY c.name ASC, c.environment ASC;