clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 1926599 fiddles created (21855 in the last week).

CREATE TABLE UNION_SALES (location VARCHAR(45), current_Price INT);
 hidden batch(es)


CREATE procedure lower10_avg_price (loc varchar(45)) BEGIN SET @a = (SELECT ceil(COUNT(*)/10) FROM UNION_SALES WHERE location = loc and current_Price >5000); SET @quer = concat( 'SELECT ROUND(avg(prices.price),2) FROM (SELECT current_Price as price FROM UNION_SALES WHERE location = ', loc,' and current_Price >5000 ORDER BY current_Price ASC LIMIT ?) as prices;'); SELECT @quer; /* PREPARE STMT FROM @quer; EXECUTE STMT USING @a; */ END
 hidden batch(es)


CALL lower10_avg_price('Αρχαία Αγορά ');
@quer
SELECT ROUND(avg(prices.price),2) FROM (SELECT current_Price as price FROM UNION_SALES WHERE location = Αρχαία Αγορά and current_Price >5000 ORDER BY current_Price ASC LIMIT ?) as prices;
 hidden batch(es)