From the course: Querying Microsoft SQL Server 2019

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Filter records with WHERE

Filter records with WHERE - SQL Server Tutorial

From the course: Querying Microsoft SQL Server 2019

Start my 1-month free trial

Filter records with WHERE

- [Instructor] The select and from clauses in a query will allow you to specify which columns from which table to return. And they'll display values from every record in the table. To limit which records are returned, you'll need to add a where clause to the statement. Let's continue working with the department table in the adventure works database. I currently have a select statement that simply reads, select star from human resources, dot, department. The results display everything that the table contains, all 16 records. If I'm only interested in departments in a specific group, I can add a where clause to filter the results. I'll go up here to the top and place my cursor right before the terminator character, that semicolon, and then I'll enter to move it down to the next line. Then I'll type in the where key word in all capital letters. Then I just need to specify the condition that I want to filter by. How about…

Contents