How to sum a value per day and then GROUP BY YEARWEEK : If i have a database with 2 columns, date and piece and i want to first count piece per day and then group by week. How wrong is my code and how to do it?

    SELECT date, piece,
    (SELECT date, COUNT(piece) 
    FROM t1 
    WHERE piece > 10
    GROUP BY date
    ) AS sum
    
    FROM t1
    GROUP BY YEARWEEK(date) 