How to write a Query which group data by holes?
Posted by: Jensan Lo
Date: January 19, 2007 03:07AM

Hi all,

I am having a problem with writting a query.
Sample Data:
ID
1
2
4
5
6
9
10

I am trying to group the data by the "holes", so that the output would be:
ID----Group
1-------1
2-------1
4-------2
5-------2
6-------2
9-------3
10-----3

Is it possible to have something like this in one query?
I am using mySQL 4.0 and therefore no stored procedures can be used.

Thank you!

Options: ReplyQuote


Subject
Written By
Posted
How to write a Query which group data by holes?
January 19, 2007 03:07AM


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.