List:General Discussion« Previous MessageNext Message »
From:Jonas Rosling Date:December 7 2006 10:05am
Subject:Grouping and summering
View as plain text  
Hi,
I'm not that used to MySQL, yet. I wonder if it's possible to do the  
following grouping with summery on a record set?
Tha records set looks as follows:

- type
- topic
- description
- time

Example of data:

Admin	Email	Email to customer A	0,25
Admin 	Email	Email to customer B	0,25
Dev		DB		Customer A DB		1,25
Dev		DB		Customer B DB		0,75
Dev		DB		Customer A DB		0,50
Admin	Email	Email to customer B	0,25

I've done the following:

SELECT
	type,
	topic,
	description
FROM
	stamps
GROUP BY
	type,
	topic

This gives me:

Admin	Email	Email to customer A	0,25
Admin	Email	Email to customer B	0,25
Dev		DB		Customer A DB		1,25
Dev		DB		Customer B DB		0,75

How I want it to look like is as follows:

Admin	Email	Email to customer A	0,25
Admin	Email	Email to customer B	0,50
				Email to customer B
Dev		DB		Customer A DB		1,75
				Customer A DB
Dev		DB		Customer B DB		0,75

Is this possible in any way? Would be very pleased for a bit of help.

Thanks in advance // Jonas
Thread
Grouping and summeringJonas Rosling7 Dec