Use QueryRecord processor and define record reader/writer controller services
add new property in the processor as
select id,name from (select count(*) over() cnt,ff.* from FLOWFILE ff)c where cnt > 10
We are using subquery count(*) over() window function on flowfile content to get count of rows from the flowfile then in outer query we are filtering out cnt column and checking the cnt is greater than 10 or not.
I have attached my flow xml here use that as a reference and prepare your sql query as per your requirements.