Using MS SQL WHERE

In MS SQL, the WHERE function is used to add a condition to the written query. It is one of the most used functions.

Let's have 2 columns named NAME and PRICE in our table called PRODUCTS. We want to fetch the record "Cake" from this table.

NAME PRICE
Fruit Juice 5
Cake 10
Beer 12
Soda 8
Water 6
Salt 15
Sugar 16

For this, the query we will write should be as follows.

SELECT * FROM PRODUCTS WHERE NAME = 'Cake'



You May Interest

Deleting Columns From a Table with a Query in MS SQL

What is the Use of DBCC Commands in SQL Server ?

Getting List of MS SQL User-Created Tables

MS SQL Show Only Date of Current Time

What is the Difference Between VARCHAR and VARCHAR(MAX) Datatypes ...