WHERE CLAUSE



MySQL - Where Clause


MySQL WHERE clause is used to filter the results from a SELECT, INSERT, UPDATE, or DELETE statement.


The syntax for the WHERE Clause in MySQL is:


SELECT field1, field2,...fieldN table_name1, table_name2...
[WHERE condition1 [AND [OR]] condition2.....

Example - With Single condition :


SELECT *
FROM studentmarks
WHERE Studentmarks = '555';


The result will be displayed as follows:

StudentIdStudentclassStudentmarks
3eighth555

Example - Using AND condition :


SELECT *
FROM studentrecord
WHERE City = 'Hyderabad'
AND PostalCode = 500046;

The result will be displayed as follows:

StudentIdStudentNameParentNameAddressPostalCodeCity
1SanjanajagannathBanjara Hills500046Hyderabad

Example - Using OR condition :


SELECT StudentName
FROM studentinfo
WHERE StudentName = 'Ajaashi'
OR StudentName = 'Sahayana';

The result will be displayed as follows:

StudentName
Ajaashi
Sahayana

Example - Combining AND & OR conditions :


SELECT *
FROM studentrecord
WHERE (ParentName = 'Praveen' AND Address = 'Camel street')
OR (Postalcode = 700096);

The result will be displayed as follows:

StudentIdStudentNameParentNameAddressPostalCodeCity
2ShivanatiniPraveenCamel street700096Kolkata


MySQL TRIGGERS

MySQL - Triggers

posted on 2019-11-29 21:44:07 - mysql Tutorials


Grant_ Revoke Privilege

MySQL - Grant_ Revoke Privilege

posted on 2019-11-26 23:15:04 - mysql Tutorials


MySQL Vs SQL

MySQL Vs SQL

posted on 2019-11-25 05:02:26 - mysql Tutorials


What Is Oracle

What Is Oracle

posted on 2019-11-29 01:11:21 - ORACLE Tutorials


TRIGGER

ORACLE - Trigger

posted on 2019-11-28 22:14:22 - ORACLE Tutorials


CURSOR

ORACLE - Cursor

posted on 2019-11-28 22:13:54 - ORACLE Tutorials