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

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -