How do I get the desired result in T-SQL like ....

Posted by Azhar on Stack Overflow See other posts from Stack Overflow or by Azhar
Published on 2010-06-12T08:53:51Z Indexed on 2010/06/12 9:02 UTC
Read the original article Hit count: 209

Filed under:
|
|

How do I get the desired result in T-SQL like .... like I have a Record like

UseriD    InDate    outDate
1         3/12/2010   3/12/2010
1         3/12/2010   3/13/2010
1         3/19/2010   3/30/2010   
2         3/2/2010    3/3/2010  
2         3/3/2010    3/4/2010
2         3/4/2010    3/29/2010 
3         2/2/2010    2/28/2010

so our result must be like this

UseriD    InDate    outDate
1         3/12/2010   3/13/2010
1         3/19/2010   3/30/2010   
2         3/2/2010    3/29/2010 
3         2/2/2010    2/28/2010

How can we do this is T-Sql

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server-2005