id partner_id date_created status item_id
3 2 1322861013 redirected 1
4 2 1322943245 redirected 6
5 3 1322943246 redirected 6
6 2 1322943247 redirected 6
如何計算具有相同item_id的行數?表名是上述我希望它輸出orders
SQL一起計算行
例子:
There's 3 rows with the item_id 6
There's 1 rows with the item_id 1
我只知道如何做到這一點稍微複雜一些的PHP循環
+1這是一個很好的例子 –