Sql Server Interview Questions

What are difference between the temp table and table variable in SQL Server?

Post Views: 1,183  Temporary Variables: 1) The temp table can be created using the #sign and table name. — Create Temporary TableCREATE TABLE #Employee (Id INT, Name VARCHAR(50)) –Insert Two rows INSERT INTO #Employee VALUES(1,’Ram’) INSERT INTO # Employee VALUES(2,’Karan’) –Retrieve the records from temp table SELECT * FROM #Employee –DROP Temporary Table query DROP […]

What are difference between Group by and Having clause in SQL Server?

Post Views: 1,151  Group by Clause: The GROUP BY clause is used in SQL for SELECT statement to collecting the data across multiple records and making the group of one or more columns. SELECT Department1, SUM(ProductSales) AS “Total ProductSales” FROM Product_order_details GROUP BY Department1;   Having Clause: The having clause is used for only on group rows […]

All Rights Reserved 2019 | DesignzRush (OPC) Pvt. Ltd.