Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Oracle (http://www.go4expert.com/forums/oracle-forum/)
-   -   Grouping Query Required (http://www.go4expert.com/forums/grouping-query-required-t5472/)

gvsrao 26Jul2007 14:10

Grouping Query Required
 
Hai Every one , Please help me in writing the query for the following requirement

Let us Suppose there is one table with two columns.

Col1 Col2
1 01-jan-07
1 01-Feb-07
1 01-mar-07
1 01-Apr-07

2 05-jan-07
2 06-Feb-07
2 07-mar-07
2 10-Apr-07

I need a query which assigns the sequnece numbers to each group. i.e. i should get the out put as follows

1 1 01-jan-07
2 1 01-Feb-07
3 1 01-mar-07
4 1 01-Apr-07


1 2 05-jan-07
2 2 06-Feb-07
3 2 07-mar-07
4 2 10-Apr-07

shabbir 26Jul2007 17:33

Re: Grouping Query Required
 
Code:

Select col1, col1, col2 from table1, table1 where table1.col2 = table2.col2


All times are GMT +5.5. The time now is 01:14.