Adding limit in sql statement