php - how to merge same value rows in mysql -



php - how to merge same value rows in mysql -

i have table looks this:

table:orders

orderid productid quantity storeid orderdate 01 1 5 1 05-10-2014 02 2 2 4 05-10-2014 03 1 1 3 05-10-2014 04 3 1 3 05-10-2014

now want retrieve above table "orders" info looks :

retrieve result

productid quantity storeid orderdate (product merge) (sum) (count) (date*) 1 6 2 05-10-2014 2 2 1 05-10-2014 3 1 1 05-10-2014

as per above "retrieve result" want merge table "orders" info productid

thanks in advance

if understood correctly, need group by. grouping them productid , select sum of quantities

select sum(quantity), count(storeid), ... orders grouping productid

php mysql

Comments

Popular posts from this blog

java Multi query from Mysql using netbeans -

c# - DotNetZip fails with "stream does not support seek operations" -

c++ - StartServiceCtrlDispatcher don't can access 1063 error -