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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-06-08 : 08:01:44
|
| Wen writes "I'm looking to track client behavior over timeHere is the basic table structureCREATE TABLE tbEventLog (ClientID int, EventType int, EventResult int, EventTIme int)What I'm interested in doing is for each ClientID that exhibits a Result of 'FAILED' for a given EventType, did it have a Result of 'SUCCESS' within the next x hours.SQL 2000 SP3a on Windows Enterprise Server 2003 RTM" |
|
|
mohdowais
Sheikh of Yak Knowledge
1456 Posts |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2004-06-08 : 08:13:57
|
| this should be close.......select a.clientid from tbEventLog ainner join tbEventLog b on a.clientid = b.clientid and a.eventtype = b.eventtypewhere a.eventresult = 'failed'and b.eventresult = 'success'and datediff(hh,a.eventtime,b.eventtime) > xyou may need to re-order the datediff a.eventtime,b.eventtime entries |
 |
|
|
|
|
|