Quote:
Originally Posted by vvalter
But i don't know, how to calculate percentages in postgresql
|
No different than with other systems by using a division: (tax / sum) * 100
Assuming sum and tax are decimal columns:
Code:
SELECT *
FROM the_table_with_no_name
WHERE (tax / sum) * 100 <> 20
If tax and sum are integer values, then you need to make sure the division is using the correct data type:
Code:
SELECT *
FROM the_table_with_no_name
WHERE (tax::decimal / sum:decimal) * 100 <> 20