How can we implement Group By include having and where clause in SQL Server and which scenario these are required for Analytics reports