I have two columns to compare. I am writing a query in Oracle SQL
I need a query to check the value of the first column if it is between +/- 5% of the second column.
Ex: If value in column B is 500, Column A should be between 525 and 475
Try this:
SELECT * FROM your_table
WHERE a BETWEEN b*0.95 AND b*1.05
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.