How to make a percentage calculation on Oracle?

Asked

Viewed 4,251 times

2

I can’t make a Select that can perform 1 ICI calculation on Oracle.

Table VS01
Campos:
PD = 001
TP = 100 reais
ICI = 15

Select PD,TP,IPI,

       TP * IPI% AS TOTAL <<< aqui que não consigo executar

From VS01

PD || TP || ICI || TOTAL

001 100 15 115

  • That’s it: select tp, ipi, sum( tp + ipi ) as total from tabela group by tp, ipi ?

2 answers

3


0

As our friend Manieiro said, it’s pure mathematics.

Just multiply the percentage by value.

Example: calculate 30% of 700.

Just multiply the fraction 30/100 by 700.

Exemplo prático

Now in PL/SQL I have the column percentage which is the value for 50% column on the right side titu_valo that is corresponds to tuition.

I do exactly as explained above, first in parentheses I do the calculation of the fraction of 50 that corresponds to 50% divided by 100 that is the denominator of the percentage and soon after multiplied by the value of the monthly fee, being thus:

((50/100) * titu_valo) 

Exemplo Prático

Upshot:

Resultado da porcentagem

Browser other questions tagged

You are not signed in. Login or sign up in order to post.