Oto Twoje zapytanie:
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;
Niestety wszystko = NULL
nigdy nie wróci prawda. Co więcej, MySQL nie obsługuje standardu ANSI NULL
-safe komparator is not distinct from
. Ale na szczęście ma alternatywę. Możesz spróbować tego:
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;