Unix Technical Forum

Grouping and summering

This is a discussion on Grouping and summering within the MySQL General forum forums, part of the MySQL category; --> Hi, I'm not that used to MySQL, yet. I wonder if it's possible to do the following grouping with ...


Go Back   Unix Technical Forum > Database Server Software > MySQL > MySQL General forum

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 05:22 AM
Jonas Rosling
 
Posts: n/a
Default Grouping and summering

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:07 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com