How to group conflict events from my table [Resolved]

Posted by Amritha444 under Sql Server on 3/23/2013 | Points: 10 | Views : 1121 | Status : [Member] | Replies : 1
Hi all

I have a event table having id,name,fromdate and to to date i want to group conflicting evnts and drop event those havnt any conflict.i want output as.the dates with no conflicts are not listed in the output.I want to identify each group thats why added groupnohow to group like this in sql server

id name fromdate todate groupno
1 a1 1/1/2013 1/2/2013 1
2 a2 1/1/2013 1/2/2013 1
3 a3 5/1/2013 10/1/2013 2
4 a4 6/1/2013 8/1/2013 2
5 25 7/1/2013 7/1/2013 2

Thanks in Advance
Amrritha




Responses

Posted by: Amritha444 on: 3/27/2013 [Member] Starter | Points: 25

Up
0
Down

Resolved
Hi i used while to iterate events add added conflicting events to temporary table.fetched conflicting events using ( @datefrom between fromdate and todate) and (@dateto between fromdate and todate)

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response