[Solved] Mysql: How do I subtract a percentage from a number

Introduction

Mysql is a powerful database management system that can be used to perform a variety of operations. One of the most common operations is subtracting a percentage from a number. This can be done using the MySQL SUBSTRING function. In this article, we will discuss how to use the SUBSTRING function to subtract a percentage from a number in MySQL. We will also provide examples of how to use the SUBSTRING function to subtract a percentage from a number.

Solution

The following query can be used to subtract a percentage from a number:

SELECT (number – (number * (percentage/100))) AS result;


Try this:

SELECT amount - (amount * discount_percentage / 100)
FROM tableA;

0

solved Mysql: How do I subtract a percentage from a number