Archived

This topic is now archived and is closed to further replies.

an sql question

This topic is 5148 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there a simpel way to limit the number of responses from a sql database? I have a table with 50000+ rows in it and an only want the 50 first or so (and yes i just want to limit the number of rows returned to me in the SQL question) I.e I have a dynamicaly built SQL query that will give more than 5000 row in response, could i somehow limit the amount of information sent to the web server sending the question? (it''s a network issue)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You didn''t mention what product you are using. I don''t know if there''s a standard way of doing this but here are examples for some products:

MySQL:
select * from sometable LIMIT 0,50

MSSQL:
select TOP 50 * from sometable

PostgreSQL:
select * from sometable LIMIT 50 OFFSET 0

Share this post


Link to post
Share on other sites