Up until now, we were able to filter the rows in the previous examples using conditional operators (=, !=, <, >, <=, >=). But what about situations when we want to be really picky and join a few conditions?
SELECT id, name FROM user WHERE age > 50 OR height < 185;
We've added a new OR clause which allows us to join more conditions.
In this case, we only select those users who are above 50 years of age or under 185 cm of height. In other words, a row is displayed when the first condition or the second condition is true. Note that if both conditions are true, the row is also displayed.
Syntax
SELECT column_name1, column_name2 FROM table_name WHERE column_name > value OR column_name < value ;
Execute below code
SELECT vin FROM car WHERE production_year <2005 OR price <10000
VIN
|
LJCPCBLCX14500264
|
JF1BR93D7BG498281
|
KLATF08Y1VB363636
|
1HGCM82633A004352
|
1G1YZ23J9P5800003
|
No comments:
Post a Comment