Removing numbers that are negative from SQL query

6.3k views Asked by At

How do you remove negative numbers from SQL query result.

Example: Select acquisitionprice-salesprice From Han.trans

I'm trying to find out the Profit by subtracting two columns from a table and would like to have the negative numbers removed from the result

1

There are 1 answers

1
Karl Kieninger On
WHERE salesprice > acquisitionprice

probably is treated as the same as giorgos-betsos commented

WHERE acquisitionprice-salesprice >= 0

but reads a little simpler to me.