Monday, April 14, 2014

T SQL Tutorial: WHERE Clause


Learn how to use the T SQL WHERE clause with syntax and examples.

Uses


The SQL WHERE clause is used to filter the results and apply conditions in a SELECT, INSERT, UPDATE, or DELETE statement.

Syntax


The syntax for the T SQL WHERE Clause is:

WHERE conditions;

Example


It is difficult to explain the syntax for the T SQL WHERE clause, so let's look at some examples.

SELECT *
FROM customer
WHERE customer_name = 'rohit';

In this SQL WHERE clause example, we've used the T SQL WHERE clause to filter our results from the customer table. The SQL statement above would return all rows from the suppliers table where the customer_name is rohit. Because the * is used in the select, all fields from the customer table would appear in the result set.

 

No comments:

Post a Comment