From the course: SQL Server Fundamentals: Master Basic Query Techniques

Unlock the full course today

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

Filtering on a single condition in SQL

Filtering on a single condition in SQL - SQL Tutorial

From the course: SQL Server Fundamentals: Master Basic Query Techniques

Start my 1-month free trial

Filtering on a single condition in SQL

- [Instructor] To really make our select queries useful, we are going to need to add some filtering conditions to answer questions like, can you show me the purchases made in the last week? Or can you show me the orders totaling over $100? And to accomplish that, we're going to need to add a where clause to our base query. Show me the results where this data point is true or false. And there are several different ways that we can do that. So first we're going to look for an exact string match. So find the rows where the service name is catering lunch. So we're going to start with our base query as we had it in our last video but we're going to add a where condition, where and the service name cause that's the condition we're considering and then equals. And I'll use single quotes around my string. And I have to remember to type the exact name of the service I'm looking for here. So we can highlight this to just run this query and we get back just this one route, and it has to be an…

Contents