I am writing a query to get two set of data. Here is how data looks like after order it by desc

```
Select RecordId,Tab, Status, CreatedDate 
from Table1
Order By Tab, CreatedDate Desc

```

| RecordId | Tab | Status | CreatedDate |
| --- | --- | --- | --- |
| 1 | 100 | 1 | 2021-10-13 08:15:02.154 |
| 1 | 100 | 2 | 2021-10-13 08:04:05.456 |
| 2 | 200 | 2 | 2021-10-13 08:13:00.198 |
| 2 | 200 | 1 | 2021-10-13 08:07:09.052 |
| 2 | 200 | 3 | 2021-10-13 08:04:03.306 |
| 3 | 300 | 1 | 2021-10-13 08:12:02.051 |
| 3 | 300 | 2 | 2021-10-13 08:08:05.158 |
| 3 | 300 | 3 | 2021-10-13 08:02:01.756 |
| 4 | 400 | 3 | 2021-10-13 08:14:01.356 |
| 4 | 400 | 1 | 2021-10-13 08:09:05.753 |
| 4 | 400 | 2 | 2021-10-13 08:05:06.152 |

First Set : Only those RecordId, which has current Status as 1 (In our case RecordId 1 and 3)

Second Set : Only those RecordId, Where it has status as 1 earlier but got changed currently (In our case RecordId 2 and 4)

Please help me in writing a query on this.