Jump to content

SUM function question regarding GROUP BY


j.smith1981

Recommended Posts

I have a problem or question regarding the SUM function.

 

I know we have to group by a column for to allow the use of the SUM function to total up a numeric value of a column.

 

Whats the easiest way, (I suppose this could be a PHP problem), to show all details in rows rather than combining them in one result.

 

Say this following example:

 

(state as it is now)

 

Orderid  Total  Status

order1  | 10  | C

order2      35    C

 

Then when I group it:

 

order1  | 10  | C

 

How would I show both these results (as in both orderid 1 and orderid 2) in mysql but then totalling them up?

 

Kind regards,

Jeremy.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.