Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Row Manipulation

Author  Topic 

taruny
Starting Member

1 Post

Posted - 2008-05-29 : 10:43:39
col1 col2 col3
1 IN NULL
2 FOR 1
3 Small 4
4 World 1
5 Hj 1
6 NJ 1
7 Welcome 1
8 So 4
9 We 1
10 Are 1
11 Resp 3
12 OIJIOJPOJPJO 7
13 OIJOIJ 1
14 LKJ 2
15 IJ 1

Is there any way, to query the above table which returns me all the 1's inside col3 until it finds any other number than 1 + the previous row preceding the 1
for eg., my 1st set would be
1 IN NULL
2 FOR 1
2nd set would look something like this
3 Small 4
4 World 1
5 Hj 1
6 NJ 1
7 Welcome 1
3rd set
8 So 4
9 We 1
10 Are 1
4th Set
12 OIJIOJPOJPJO 7
13 OIJOIJ 1

and the last set
14 LKJ 2
15 IJ 1

Any help is appreciated!!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-29 : 12:10:03
And how do you want to display the sets?
Go to Top of Page
   

- Advertisement -