Lesson 5: Filtering results using the WHERE Clause and GREATER THAN.
SQL WHERE Clause Comparison Operators.
The WHERE clause also lets us use a range of other comparison operators.
We'll look at a list of the different comparison operators we can use and see an example of the Greater Than operator action. You should familiar with most of these from school maths class but it never hurts to have a refresher.
Most common comparison operators.
|!=||NOT Equal to|
|\<>||NOT Equal to|
|\<=||Less than OR Equal to|
|>=||Greater than OR Equal to|
An example with GREATER THAN.
The GREATER THAN operator lets us filter our data table on numerical fields where the value is greater than the value we specify. For example, to get all products that cost more than $10 our query would be:
SELECT *FROM ProductsWHERE price > 10;
This mission is going to require a little lifting of things off the top shelf. That means we need characters with a little height to help us out (sorry Spidey).
Write a SQL query that gets us all characters with height greater than 180cm.