Solution: To subtract two values in sql, simply use - (minus) between two values.
For Example:
SELECT sellprice - costprice AS profit FROM account
Explaination:
SELECT: is used in a statement which returns a result from one or more tables. It is known to be DML language (Data Manipulation Language)
AS : used to give a alias name to the column in result.
No comments:
Post a Comment