I have a table such as below which holds a list of transactions by date, location and device. There are gaps in the transaction record for most devices.
date location device Transaction
----------------------- ---------------------- ---------------------- ----------------------
2020-09-04 00:00:00.000 101 62 462
2020-09-04 00:00:00.000 101 62 463
2020-09-04 00:00:00.000 101 62 464
2020-09-04 00:00:00.000 101 62 465
2020-09-04 00:00:00.000 101 62 471
2020-09-04 00:00:00.000 101 62 472
2020-09-04 00:00:00.000 101 62 473
2020-09-04 00:00:00.000 101 63 300
2020-09-04 00:00:00.000 101 63 301
2020-09-04 00:00:00.000 101 63 302
2020-09-04 00:00:00.000 101 63 303
2020-09-04 00:00:00.000 101 63 304
2020-09-04 00:00:00.000 101 63 305
2020-09-04 00:00:00.000 101 63 306
2020-09-04 00:00:00.000 101 63 311
2020-09-04 00:00:00.000 101 63 312
2020-09-04 00:00:00.000 101 63 313
I'm trying to write a query which returns the missing transactions along with the date,location and device. The output I need is here
date location device Transaction
----------------------- ---------------------- ---------------------- ----------------------
2020-09-04 00:00:00.000 101 62 466
2020-09-04 00:00:00.000 101 62 467
2020-09-04 00:00:00.000 101 62 468
2020-09-04 00:00:00.000 101 62 469
2020-09-04 00:00:00.000 101 62 470
2020-09-04 00:00:00.000 101 63 307
2020-09-04 00:00:00.000 101 63 308
2020-09-04 00:00:00.000 101 63 309
2020-09-04 00:00:00.000 101 63 310