This is an MSSQL query an incomplete one. I am seeking a complete query.
As we all know if we use aggregate function we must use GROUP BY clause for all SELECT columns and this will affect my desired result. The possible solution is to use sub query. If anyone can help me out with this it would be a great help. https://code.sololearn.com/wUcDgH7lP998/?ref=app