I have a table like
Id Value
1 Start
2 Normal
3 End
4 Normal
5 Start
6 Normal
7 Normal
8 End
9 Normal
I have to bring the output like
id Value
1 Start
2 Normal
3 End
5 Start
6 Normal
7 Normal
8 End
i.e. the records between Start & End. Records with id's 4 & 9 are outside the Start & End henceforth are not there in the output.
How to do this in set based manner (SQLServer 2005)?