How to SELECT sum of numbers less than 30 and sum of numbers greater than 30?
If i understand correctly, you have a single column which has numeric values and you want to find sum of this field for all thw rows where the field value is less than 30 and same condition with the variation of field value greater than 30. If this is correct, then you can use the below query and replcae the table and column name accordingly.
SELECT SUM(CASE WHEN col1 < 30 THEN COL1 ELSE 0 END ) SUM(CASE WHEN col1 < 30 THEN COL1 ELSE 0 END ) FROM DATABASE.SCHEMANAME.TABLE
Thanks,Atul