Professional Documents
Culture Documents
It is sometimes necessary to specify multiple values in WHERE clause. The IN operator is used in order
to specify multiple values in WHERE clause. It is a shorthand for multiple OR conditions.
IN Syntax:
SELECT column_name(s)
FROM table_name
WHERE column_name IN (value1, value2, ...);
Another form of this syntax is
SELECT column_name(s)
FROM table_name
WHERE column_name IN (SELECT STATEMENT);
SELECT column_name(s)
FROM table_name
WHERE column_name BETWEEN value1 AND value2;
SQL JOIN
In order to combine rows from two or more tables, SQL JOIN clause is used. There are different types of
JOINs.
(INNER) JOIN:In order to show records that matches from both table, (INNER) JOIN is used.
INNER JOIN Syntax:
SELECT column_name(s)
FROM table1
INNER JOIN table2
ON table1.column_name = table2.column_name;
LEFT (OUTTER) JOIN: This function returns records from the left table and matches records from the
right table.