What is WHERE statement good for in SQL server script?
Experience Level: Junior
Tags: DatabasesMS SQL ServerQuality Assurance (QA)
Answer
The WHERE
statement is used the most often in conjunction with SELECT
statement. It applies the filtering condition so only the rows that match the condition defined after WHERE
statement are returned in result-set.
The following query will return only customers who ordered more than 3 times.
Related Databases job interview questions
What is the meaning of ASC and DESC keywords in SQL server?
DatabasesQuality Assurance (QA) JuniorWhat is ORDER BY statement used for in Microsoft SQL server?
DatabasesMS SQL ServerQuality Assurance (QA) JuniorWhat is DISTINCT and what is good for?
DatabasesMS SQL ServerQuality Assurance (QA) JuniorWhat is TOP and what is it good for in SQL server script?
DatabasesQuality Assurance (QA) JuniorUsing SQL query, how do you limit number of returned rows using TOP(x)?
DatabasesMS SQL ServerQuality Assurance (QA) Junior