Hi all...
I need help in forming a SQL Query.
Requirements are as follows-
I have a table as below -
| ID  | Repoonse  | Company  | Key  | 
|  1 |  Error | A  | V1  | 
|  2 |  Success |  B |  V1 | 
|  3 |  Error |  C |  V1 | 
|  4 |  Error |  D |  V2 | 
|  5 | Success  |  E |  V2 | 
|  6 | Error  | F  |  V2 | 
|  7 |  Error |  G |  V3 | 
|  8 |  Success |  H |  V3 | 
Now, my logic is -
I need all the records till I get success for each key.
Eg -
My result should be -
|  ID | Response  | Company  | Key  | 
|  1 |  Error | A  | V1  | 
|  4 | Error  | D | V2 | 
|  7 | Error | G |  V3 | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 
Here, key V1 have success (in Response column). Hence, this key should not be picked anymore.
Key V2 have success (in ID-5). Hence, this key should not be picked any more.
No record should be picked once the Key have success.
I have to call this procedure on Timer Control on every 5 Minutes.
Hence, After 5 minutes, the records in the grid should not display the records of ID-1,4,7.
The main table will get updated every 2 minutes.
Once the Key hits a success, that record should not be picked.
This is a type of schedular.
Please help me out.
Thanks all in advance...