Say I define an alias \'count\' in my Select Query and I want to limit the amount returned to count / 5 (or 20% of the table).
How can I do this? Mysql doesn\'t s
the LIMIT clause can takes 2 arguments and must be integers constants.
you can try something like this
SET @skip=1; SET @numrows=(select count(*) div 5 from tbl ); PREPARE STMT FROM 'SELECT * FROM tbl LIMIT ?, ?'; EXECUTE STMT USING @skip, @numrows;