« Life Of Cursed Sin | Main | metaforos »

statom monstriukus

Pasirodo programerių dienos ucfirst() implementacija patapo naudinga:


SELECT
DISTINCT(
CONCAT(
UCASE(
LEFT(a.category,1)
),
SUBSTRING(a.category,2)
)
) AS name,
COUNT(b.id) AS count
FROM tasks AS a, tasks AS b
WHERE a.id = b.id
AND a.pid=1
GROUP BY a.category
ORDER BY name

Comments

Jei tai yra mysql, SELECT DISTINCT nereikia '('.