Format SQL to display data in a group?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
influenceuk
Forum Commoner
Posts: 42
Joined: Tue May 08, 2007 7:48 am
Location: London, UK

Format SQL to display data in a group?

Post by influenceuk »

Can any one tell me if there is a way to display data from a MySQL DB in groups?

For example:

May:
Item 1 1/05/2007
Item 2 2/05/2007
Item 3 3/05/2007

June:
Item 4 1/06/2007
Item 5 2/06/2007
Item 6 3/06/2007

And so on...

Obviously i would be after having a title of that current month etc. But would need the data to go and update on its own, so once may has gone, June would be he first month, if you see what i mean?

Any help would be great cheers:D
mentor
Forum Contributor
Posts: 100
Joined: Sun Mar 11, 2007 11:10 am
Location: Pakistan

Post by mentor »

Try ROLLUP.
Post Reply