clock  Mon - Sun 8.00 AM - 8.00 PM
mail  edu@teknowize.com
fb
instagram
play store
pinterest

More

SQL logical operators

Imperial Advance Hero Image

SQL logical operators

The logical operators are used to find smaller, greater, equal values from same column.

 

1) Equal to

It is used to find data from a table according to the 'equal to' condition.

 

Syntax -

Select * from table_name where column_name  = column_data;



2) Not equal to

It is used to find data from a table according to the 'not equal to' condition.

 

Syntax -

Select * from table_name where column_name  != coumn_data;



3) Greater than or less than

It is used to find data from a table according to the 'greater than or less than' condition.

 

Syntax -

Select * from table_name where column_name  > column_data;
Select * from table_name where column_name  < column_data;



 4) Greater than equal to or less than equal to

It is used to find data from a table according to the 'greater than equal to or less than equal to' condition.

 

Syntax -

Select * from table_name where column_name  > = column_data;
Select * from table_name where column_name  < = column_data;



5) Data of anyone

It is used to find data of anyone from a table.

 

Syntax -

Select * from table_name where column_name  in ( ‘name1’, ‘name 2’,………. );



                                             OR

Select * from table_name where column_name  = ‘name1’ or  column_name  = ‘name 2’ or  ……….);

 

MySql