Avoid Functions/Procedures with SQL statement using Group By clause (SQL Server) | CAST Appmarq