_underdog
06-20-2002, 01:14 PM
Hi all! I am a java web programmer, but I use mySQL as my backend database. Thought maybe someone here could give me some suggestions.
I have a java webapp that allows users to query a database table and get results back in an html table. My query looks something like this:
SELECT [columnNames]
FROM [tableName]
WHERE [some conditions (specified by the user)]
ORDERBY [columnX (also specified by the user)], id
If the user does not limit their search criteria the results can get large and it can take a while to run the query.
I only really need the first 50 records because I display 50 at a time. Is there any way I can limit my results returned by the server and still maintain my sorting?
I have a java webapp that allows users to query a database table and get results back in an html table. My query looks something like this:
SELECT [columnNames]
FROM [tableName]
WHERE [some conditions (specified by the user)]
ORDERBY [columnX (also specified by the user)], id
If the user does not limit their search criteria the results can get large and it can take a while to run the query.
I only really need the first 50 records because I display 50 at a time. Is there any way I can limit my results returned by the server and still maintain my sorting?