I am trying to figure out how I can output any machine that has had the latest 3 backups be larger than 10GB. My SQL Table looks similar to the below table:
ComputerID | BackupImageName | WindowsVolumeGUID | FileSize | TimeCreated
1234 | PCBackup.spi | kjsdfai-dadad-ddd | 10400 | 05-22-20
1234 | PCBackup1.spi | kjsdfai-dadad-ddd | 10500 | 05-23-20
1234 | PCBackup2.spi | kjsdfai-dadad-ddd | 10300 | 05-24-20
1234 | PCBackup3.spi | kjsdfai-dadad-ddd | 10900 | 05-25-20
1225 | PCBackup4.spi | kjsdfa5-dadad-ddd | 10600 | 05-22-20
1225 | PCBackup5.spi | kjsdfa5-dadad-ddd | 5000 | 05-23-20
1225 | PCBackup6.spi | kjsdfa5-dadad-ddd | 10000 | 05-24-20
1225 | PCBackup7.spi | kjsdfa5-dadad-ddd | 4588 | 05-25-20
I need to output all machines (computerID's) or Volumes (WindowsVolumeGUID) that have their latest 3 files in the list greater than 10000 file size. So from the above table it would output the computerID of 1234 because its latest 3 are greater than 10000 file size and even though the computerID 1225 has 2 files greater than 10000 it would not output the result because there is a break in-between the two large files. The search will need to take into account the WindowsVolumeGUID since some machines have more than one volume and I need to take into account the individual volume backups and count the latest entries based on that.
Alternatively, I can also accomplish the same thing if there is a way to output the top 3 results for each unique WindowsVolumeGUID and not just across the board.
Any help would be greatly appreciated!