sum - SQL query command -


i new sql , need find command in order generate report regarding table have:

column1     tax      amount      350        45        x             6500       53        y   800        25        z 

i need calculate x, y , z. need math:

=if(column1 <= 5000, column1 + tax, column1)  

in words: need calculate x/y/z sum of column1+tax options:

  • if column1 smaller or equal 5000 x = column1 + tax;
  • if column1 > 5000 x or y or z should have column1 value result

can me find sql query calculates x or y or z?

2

select column1, tax,     case when column1 <= 5000 column1 + tax          else column1     end amount yourtable 

Comments

Popular posts from this blog

testing - Detect whether test has failed within fixture -

android - Create single AAR file from multiple modules using Gradle -

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -