MySQL Forums
Forum List  »  Newbie

Group By Sequential IDs
Posted by: Christian Augustine
Date: March 22, 2010 08:42AM

Hey I'm wondering if someone can help me with this.

I'm trying to find a way to group a set of results by blocks of sequential IDs.
For example, say my query returned these results:

1 - banana
2 - apple
3 - lemon
8 - Fork
9 - Knife

Once I added my group by (along with a count) I would like it to look like this:

1 - 3
2 - 2

Any ideas on how I could get this set of results?

Thanks :)

Options: ReplyQuote


Subject
Written By
Posted
Group By Sequential IDs
March 22, 2010 08:42AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.