The WHERE Clause

Filters allow you to limit the number of rows returned by your queries. You set criteria to filter out rows that don't match a certain conditional statement. The SQL WHERE clause is always going to be in front of any conditions you specify.

You can filter which rows will be returned when running SQL queries by using the SQL WHERE clause. This clause enables you specify a search condition in the query to restrict the number of rows returned in the result set. Listing 4.3 illustrates the basic structure of the SQL WHERE clause.

Listing 4.3. The Basic Structure of the WHERE Clause
[ WHERE < search_condition >

Using the preceding SELECT statement example, you can filter out all products except those supplied by the supplier with ...

Get Programming Data-Driven Web Applications with ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.