MySql Where Clause

The WHERE clause

The WHERE clause is used to filter records from Table.

Syntax

SELECT column_name(s)FROM 
table_name
WHERE column_name operator value

If you use the SELECT statement to query the data from a table without the WHERE clause, you will get all rows in the table, which sometimes brings more data than you need. The WHERE clause allows you to specify exact rows to select based on given conditions

Get The records for firstname , last name where salary>=10000

SELECT firstName, lastName
FROM emp
WHERE salary >=10000;

Get The records for firstname , last name where salary>=10000 and Manager id is 1001

SELECT firstName, lastName
FROM emp
WHERE salary >=10000 and manager=1001;

Admin has written 171 articles

Leave a Reply