MySQL GROUP BY and COUNT
问题 I have a small problem regarding a count after grouping some elements from a mysql table, I have an orders table .. in which each order has several rows grouped by a code (named as codcomanda) ... I have to do a query which counts the number of orders per customer and lists only the name and number of orders. This is what i came up (this might be dumb ... i'm not a pro programmer) SELECT a.nume, a.tel, ( SELECT COUNT(*) AS `count` FROM ( SELECT id AS `lwtemp` FROM lw_comenzi_confirmate AS yt