how to calculate the sum of the selected entries of a column in Magento 2

I want to calculate the sum of all total purchase values ​​whose ref_by the value is 1. The name of the table is name of the table. Can anybody help me please?

I want SQL query that will return total (200 + 97 + 140)

enter the description of the image here