I've found numerous options for finding missing sequence numbers where the sequence is straight-forward. In my case it's only part of a business key and I can't get my head around how I would use one of those methods in my case.
I have a table where generation in MW is recorded every half hour of the day for around 60 electricity generation stations. The key of each row is Station Node Code, Trading Date and Period ID. Each day has 46, 48 or 50 periods. 46 when we change to Daylight Savings and skip an hour and 50 when we revert to Standard Time and repeat an hour.
So, for each trading date and Station, I'd like to know if there are any trading periods missing.
As you can see for one of these stations, we're not missing any measurement periods on that trading day but we are for the others. I'd like to produce a list that would show just those stations, trading dates and trading periods where there is no row like this:
ARA2201 ARA0 2022-04-03 7
ARA2201 ARA0 2022-04-03 8
ARI1101 ARI0 2022-04-03 7
ARI1101 ARI0 2022-04-03 8