SQL – Where Clause (Filter Values)

Spread the love

Where Clause

Where – it filters the values in table basis on specified filters , it can be used in with select , update and delete statement

Multiple options to filter the values using where clause –  Operators , And , Or, In , Between , Wild Card and Like

Syntax –

Select column1, column2 from table_name where column1 ( then condition )
Update table_name set = column1 = ‘new value’ where column1 (then condition)
delete from table_name where column1 (then condition)

Table Brand

S.NOPRODUCTMONTHYEAR
1NIKEDEC2016
2REEBOKJAN2014
3FILAFEB2017
4PUMAJAN2015
5REEBOKFEB2016
6FILAMAR2015

Select * from Brand Where Product = ‘FILA’

Result

S.NOPRODUCTMONTHYEAR
3FILAFEB2017
6FILAMAR2015

 

Update Brand set product = ‘Adidas’ where Product = ‘Fila’ and Month = ‘Mar’ and Year = 2015

This row will be delete

S.NOPRODUCTMONTHYEAR
6FILAMAR2015

Result – Changed Value

S.NOPRODUCTMONTHYEAR
6AdidasMAR2015

 

 

Delete from Brand Where Product = ‘FILA’ and Month = ‘Mar’

This row will be delete

S.NOPRODUCTMONTHYEAR
6FILAMAR2015

 

 

 

 

 

 

sql update values search keyword
update values values search keyword
update values into table sql search keyword
update values into table search keyword
update values into a table search keyword
update records into a table search keyword
update valuescommand sql search keyword
select update valuesby sql query search keyword
sql query find update valuesfrom table search keyword
sql update values into table search keyword
sql update values into a table search keyword
sql update records into a table search keyword
sql update data into a table search keyword
sql update data into table search keyword
sql update data into existing table search keyword
sql delete valuesvalues search keyword
delete valuesvalues search keyword
delete values into table sql search keyword
delete values into table search keyword
delete values into a table search keyword
delete records into a table search keyword
delete values command sql search keyword
select delete valuesby sql query search keyword
sql query find delete values from table search keyword
sql delete values into table search keyword
sql delete values into a table search keyword
sql delete records into a table search keyword
sql delete data into a table search keyword
sql delete data into table search keyword
sql delete data into existing table search keyword
sql filter values search keyword
filter values search keyword
filter values into table sql search keyword
filter values into table search keyword
filter values into a table search keyword
filter records into a table search keyword
filter values command sql search keyword
select filter valuesby sql query search keyword
sql query find filter values from table search keyword
sql filter values into table search keyword
sql filter values into a table search keyword
sql filter records into a table search keyword
sql filter data into a table search keyword
sql filter data into table search keyword
sql filter data into existing table search keyword