hi all,
one of my friends asked me a question and i feel that it can be done but how ?
without using PLSQL, can it be done by sql ?
we have a table and its data like that:
X Y
----------
A S
B S
C S
D T
E T
F S
G S
H R
I want to order this data be field X (which is already done in this example) and group this data by Y field
but if in the order the value of Y field changes, this means that will be a new group.
I mean, for this example, A, B and C records is a group, D and E is an another group
and E and F is an another group. as you see ABC records and EF records has same Y field value (which is S) but I want to assume that they are different groups because of the order.
if I give a number the groups it looks like this:
X Y
----------
A S 1
B S 1
C S 1
D T 2
E T 2
F S 3
G S 3
H R 4
I have 4 different group in here. any idea ?
PS: we dont want to use plsql, just sql