I have a table lets call it Foo with these columns DeviceId, TransactionId, IndetId, Datetime, SalesTransactionTypeId, and Quantity and some more columns
If I have rows that are identical for columns DeviceId, TransactionId, IndetId, Datetime, SalesTransactionTypeId I want to select only the first one and skip the rest.
An example
DeviceId TransactionId IndetId Datetime SalesTransactionTypeId Quantity
123 10 8 2022-12-12 700 45
123 10 8 2022-12-12 700 75
In this example only the firsr row should be returned.
I can't use a simple distinct because I need all columns to be returned