Loading

MySQL Compound Operators

Add equals(+=):- Syntax will be
SELECT column1+=column2 FROM TableName;
For Example:- Select (age+=10) from Employeetable;
It will increment the age of the employee
Subtract equals(-=):-Syntax will be
SELECT column1-=column2 FROM TableName;
For example:-
Select (age-=10) from Employeetable;
It will decrement the age of employee

Multiply equals(*=):-Syntax will be
SELECT column1*=column2 FROM TableName;
For example:-
Select (age*=10) from Employeetable;
It will multiply the age of the employee

Divide equals(/=):-Syntax will be
SELECT column1/=column2 FROM TableName;
For example:-
Select (age/=10) from Employeetable;
It will divide the age of the employee

Modulo equals(%=):-Syntax will be
SELECT column1%=column2 FROM TableName;
For example:-
Select (age%=10) from Employeetable;
It will send a reminder of the age of the employee after divion
Bitwise AND equals(&=):-Syntax will be
SELECT column1&=column2 FROM TableName;
Bitwise exclusive equals(^-=):-Syntax will be
SELECT column^-=column2 FROM TableName;
Bitwise OR equals(|*=):-Syntax will be
SELECT column |*=column2 FROM TableName;

Share with:


Leave a Reply

Connect with:

z35W7z4v9z8w