Getting next row using SQL

Posted by Peter on Stack Overflow See other posts from Stack Overflow or by Peter
Published on 2010-03-22T17:06:54Z Indexed on 2010/03/22 17:11 UTC
Read the original article Hit count: 481

Filed under:
|

I have 2 tables with data thus:

Col1      Col2  
------- --------  
Admin001  A  
Admin001  B  
Admin002  C   
Admin002  C  
Admin003  A  
Admin003  C

I need to find all instances of Col2 values with 'A' immediately followed by 'B'. 'A' followed by any other symbol does not count. Is there a way to use SQL to accomplish this?
Environment is DB2 LUW v9.5

© Stack Overflow or respective owner

Related posts about sql

Related posts about db2