mysql - How to do a count query that groups by distinct product -


ok have query

select * configure_system estimateid='edb95py0z2'  , stepid=1 

which return following 8 rows...i need query returns distinct productid , total price , quantity of them ...so example

i want this

productid   productprice totalprice quantity 2           575          1175       2 3           839          1678       2 9           1349         4047       3 12          1699         1699       2 

i tried using distinct query , count have not been successful

select   productid                            ,          productprice                         ,          count(*) * productprice totalprice,          count(*)                quantity     configure_system    estimateid='edb95py0z2' ,      stepid    =1 group productid,          productprice 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -