Dit is uw vraag:
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;
Helaas, alles = NULL
zal nooit waar terugkeren. Helaas ondersteunt MySQL de ANSI-standaard NULL
niet -safe comparator is not distinct from
. Maar gelukkig heeft het een alternatief. Je kunt dit proberen:
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;