SQL Selecting with Condition

Download SQL for free

Example

The basic syntax of SELECT with WHERE clause is:

SELECT column1, column2, columnN
FROM table_name
WHERE [condition]

The [condition] can be any SQL expression, specified using comparison or logical operators like >, <, =, <>, >=, <=, LIKE, NOT, IN, BETWEEN etc.

The following statement returns all columns from the table 'Cars' where the status column is 'READY':

SELECT * FROM Cars WHERE status = 'READY'

See WHERE and HAVING for more examples.

Selecting with more than 1 condition.