MySQL Part 8: Logical Operators
Introduction In this article, we discuss some simple logical operators in MySQL. In the last article, we discussed the standard MySQL date functions. Click the link below to check out that article. MySQL Part 7: Dates To begin your MySQL session in the goormIDE, please be sure to type this code into the terminal. mysql - ctl cli Please ensure that the bike_shop.sql file is selected and available. If not, double-click it on the left-hand side. This is where we will type most of our code. If there is information saved in there, go ahead and clear out that information. WHERE Function One of the most highly used logical operators in MySQL is the WHERE function. In the first WHERE clause, we are filtering solely on customer_id equal (=) to 2. In the second query, we are filtering on all customer_ids not equal (!=) to 2. See the code and the different outputs below. USE bike_shop_app; SELECT * FROM orderlines WHERE customer_id = 2 ; ...