So, is the sum of all the names equal to X, and the price is greater than 10 and greater than Z?
Suppose your total demand is that the sum of all amounts greater than 10 is greater than z, then what is displayed? Do you want to display all the contents with the name equal to X and the price greater than 10? So what if the sum of all quantities is not greater than z? Don't you show it Is the calculated amount less than 10? It should not count.
If I am right above, then the following statement can be almost completed, and the statement may not be executed (there is no environment to test, only for reference). You can try to understand the subquery I connected with the table, which may be more intuitive.
select name,price,amount from table where table . name in(select name from table where price & gt; Group y is named sum(smount)>z) and table.price & gtY.