Вижте http://dev.mysql.com/doc/ refman/5.0/en/counting-rows.html
Така че вашата заявка би била
SELECT session_id, COUNT(*)
FROM gallery_list
GROUP BY session_id
Вижте http://dev.mysql.com/doc/ refman/5.0/en/counting-rows.html
Така че вашата заявка би била
SELECT session_id, COUNT(*)
FROM gallery_list
GROUP BY session_id