<?php$num = 2;echo "select sum(peso) from (select peso from dados order by id asc limit $num) as subt";
Standard input is empty
select sum(peso) from (select peso from dados order by id asc limit 2) as subt
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!