I have something i need to do and i don't know how to do it :)
I have the following data :
The result i want to have
Those data come from a query with a group by (let say it's the data from multiple store and some store have a different "Type" than other).
What i need to do is to be able to get only one row by "Art" but with the best "Type" ("Type" = to the cashback for a Customer)
I need to take the "Type" in that order
How can i put it in my T-SQL statement ? I can still do something later in .NET but i would rather put everything in the SQL Statement.
Thank you for your help :)