SQL Comparison Operators

Comparison operators: Comparison operators allow row retrieval  from table based on the condition specified in the WHERE clause.

Here is the list of all comparison operators available in SQL.
Operator
Description
=Equal to
>Greater than
<Less than
>=Greater than or equal to 
<=Less than or equal to
<>, !=Not equal to
!>Not greater than
<!Not Less than
()Controls precedence


SQL WHERE Clause

There are situations in which only a few rows need to be retrieved from the table based on a condition. The WHERE clause is provided by SQL server to specify the condition. The WHERE clause not only used in SELECT statement, but it is also used in UPDATE, DELETE statement etc.

The syntax for using the WHERE clause is:
SELECT column_list FROM table_name WHERE search_condition

SQL SELECT DISTINCT Statement

The DISTINCT keyword removes duplicate rows from the result set. By default query return all the records including duplicates. Duplicate rows can be eliminated by using DISTINCT keyword in the SELECT statement.

SQL SELECT DISTINCT Syntax: 
SELECT DISTINCT column_name,column_name FROM table_name;

SQL SELECT Statement

SELECT statement is the most commonly used SQL command. The SELECT statement is used to access and retrieve data from database. A SELECT statement prompts the server to prepare result and return it to the client application. The keywords SELECT, FROM and WHERE make up the basic SELECT statement.