Pregunta de entrevista de eClinicalWorks

What is the difference between having and where clause in SQL? What is Indexing in SQL?

Respuesta de la entrevista

Anónimo

22 oct 2017

1) The WHERE clause is used to filer rows from a results. For instance SELECT COUNT(SalesOrderID) FROM Sales.SalesOrderDetail 2) The HAVING clause is used to filter values in a GROUP BY. You can use them to filter out groups such as SELECT SalesOrderID, SUM(UnitPrice * OrderQty) AS TotalPrice FROM Sales.SalesOrderDetail GROUP BY SalesOrderID HAVING SalesOrderID > 50000

2