This syntax worked for me on an actual database table I use:
SELECT * FROM offenders limit 10 offset 20
Make sure you have selected a valid schema name in your connection component or
add it like so to the query:
SELECT * FROM ejail.offenders limit 10 offset 20
If you don't have spaces (" ") in the schema or table names, then you don't
need to add quotes to the names. You only need to specify the schema if you
want to override the default schema or there is some ambiguity of table names
in different schemas.
It you actually put the string "table" into your query, then that would cause
an error. You must use a valid schema/table name that exists in MySQL.
Also note that if your offset is greater than the number of records in the
table, MySQL can take a long time to return an empty result set.
My advice is to use the MySQL GUI Query Browser to test out your queries before
coding them into Delphi. Once you get the results you like, paste the query
into your component's SQL property and add any query parameters you like. The
Query Browser will give you better error messages and show you (sort of) where
your syntax errors are. It also has a nicely done Help section that shows the
entire MySQL syntax structure with lots of examples.
The MySQL GUI utilities are free for downloading on the MySQL web site. You can
also use the MySQL Workbench (also free), but I think it is pretty awful. It
looks like it was designed by a clueless newbie focus group - on drugs. :-)
Best regards,
Kevin G. McCoy
--- In [email protected], "forbvijay" <forbvi...@...> wrote:
>
>
> correction to the entered query it should be as 'select * from table limit 10
> offset 20;'
>
> thanks,
> vijay.
>
>
>
> --- In [email protected], "forbvijay" <forbvijay@> wrote:
> >
> > hi,
> >
> > do any one know how to request a "live result set" in MySQl when query
> > has offset(eg: select * from table where limit 10 offset 20;). it is
> > throughing an error like 'invalid use of keyword'.
> >
> > Thanks,
> > Vijay.
> >
>