I want TSQL statement to find the hat trick details based on run.
ID | Over | Ball | Run |
101 | 1 | 1 | 0 |
102 | 1 | 2 | 1 |
103 | 1 | 3 | 1 |
104 | 1 | 4 | 1 |
105 | 1 | 5 | 2 |
106 | 1 | 6 | 2 |
107 | 2 | 1 | 4 |
108 | 2 | 2 | 4 |
109 | 2 | 3 | 4 |
110 | 2 | 4 | 1 |
111 | 2 | 5 | 2 |
112 | 2 | 6 | 1 |
Result:
102 | 1 | 2 | 1 |
103 | 1 | 3 | 1 |
104 | 1 | 4 | 1 |
107 | 2 | 1 | 4 |
108 | 2 | 2 | 4 |
109 | 2 | 3 | 4 |