SQL WHERE CLAUSE

SQL WHERE CLAUSE:

The SQL WHERE clause is used to specify a condition while fetching the data from single table or joining with multiple tables.

If the given condition is satisfied then only it returns specific value from the table. You would use WHERE clause to filter the records and fetching only necessary records.


SYNTAX:

SELECT column1, column2....columnN
FROM   table_name
WHERE  CONDITION;

EXAMPLE:

SELECT * from student where result='pass';
Displays all the column values of table student where column result has pass value.

SELECT  name from student where result='fail';
Displays only the values of column name from table student where result has fail value.

No comments:

Post a Comment