SQL WHERE

SQL WHERE clause used along with the SQL SELECT statement to conditionally retrieve the record from one or more tables.

Syntax:

SELECT Columns
FROM Tables
WHERE column_name operator value

Operators: =, >, <, >=, <=, <>, !=, LIKE, IN and AND.

Some Samples:

SELECT Column1
FROM table_name
WHERE column_name = 10

SELECT column_2
FROM table_name
WHERE column_2 = ‘TEST’

SELECT column_name(s)
FROM table_name
WHERE column_3 like ‘%SQL%’

SELECT column_name(s)
FROM table_name
WHERE column_name = 21 AND Column_2 = ‘Hello’

28 views

Return to top