SELECT t1.filterOptionId, %s(t1.optionNumber) as optionNumber FROM `productFilterOptionNumber` as t1
LEFT JOIN productCategory as t2 ON t1.productId = t2.productId
WHERE (t2.categoryId = %d)
GROUP BY t1.filterOptionId