Is there a way in SQL to specify how many rows you would like to be returned. One example, where this could be useful is when you want to make sure that a certain record exists in a table. You would specify that you're only looking for 1 row and ideally database engine would stop searching as soon as it finds it (which on average would be middle of the table). For big tables this could make a lot of difference. Other times, I would be interested in obtaining the top/botton 100 rows from a certain table.
Any ideas?
Any ideas?