mysql - count number of sales for each ID -
i have sales_log
database
itemid status 250 completed 251 completed 260 completed 251 completed
i want query number of sales of each item id
itemid sales 250 1 251 2 260 1
so presumably need select item ids where status completed, group by item id, making sure count grouped rows.
those italicised keywords should more enough solve problem, provided invest time in learning tools.
Comments
Post a Comment