There is no logical difference.  There's a tiny bit of overhead in
preparing and executing the statements, but if you have a query where
the limit is variable, a prepared statement might be better than
coding within an application, because then when ANY user or
application connects it can use that prepared statement.

-Sheeri

On 4/3/06, Yemi Obembe <[EMAIL PROTECTED]> wrote:
> what is the difference between this:
>
> SET @a=1; PREPARE STMT FROM 'SELECT * FROM tbl LIMIT ?';EXECUTE STMT USING
> @a;
>
> and this:
> 'SELECT * FROM tbl LIMIT 1
>
> And then this:
>
> SET @skip=1; SET @numrows=5;
> PREPARE STMT FROM 'SELECT * FROM tbl LIMIT ?, ?';
> EXECUTE STMT USING @skip, @numrows;
>
> and this:
> 'SELECT * FROM tbl LIMIT 1,5
>
>

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to