What I want is the (SELECT ) to be run with the value of each GROUP.. it doesn't seem to do that now, what am i doing wrong?
SELECT
MAX(ksc.computerLastLogin) max,
(SELECT MIN(usageWhen) FROM KSUsage
WHERE usageEvent = 16
AND usageComputerID = ksc.computerID) min,
ksc.computerDivisionID id,
ksd.divisionName name
FROM KSComputers ksc
JOIN KSComputerDivisions ksd ON ksc.computerDivisionID = ksd.divisionID
WHERE ksc.computerDivisionID != 0
GROUP BY ksc.computerDivisionID
ORDER BY name;