TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

MySQL OR Condition

MySQL OR Condition example with examples on CRUD, insert statement, select statement, update statement, delete statement, use database, keys, joins etc.

<< Back to MYSQL

MySQL OR Condition

The MySQL OR condition specifies that if you take two or more conditions then one of the conditions must be fulfilled to get the records as result.

Syntax:

WHERE condition1
OR condition2
...
OR condition_n;

Parameter explanation

condition1, condition2, ... condition_n: Specifies all conditions that must be fulfilled for the records to be selected.

MySQL OR Example

The following example specifies how to use the OR condition in MySQL with SELECT statement.

Consider a table "cus_tbl", having the following data:

MySQL OR Condition 1

Execute the following query:

SELECT *
FROM cus_tbl
WHERE cus_firstname = 'Ajeet'
OR cus_id > 100;

Output:

MySQL OR Condition 2

Note: In the above example you can see that the second condition "cus_id" is wrong but the query is displaying the correct result because of the OR condition.

Next TopicMySQL AND OR




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf