Solved

How to limit how many rows I wish to get

Posted on 1998-07-14
4
172 Views
Last Modified: 2010-03-19
I have a huge database and also huge query. I would like to
add a possibility to limit a report of let's say 100 rows.
As I have tried with count() it took a half an hour till I
have had enough and had killed a process.
What to do?
0
Comment
Question by:gljsentvid16
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
connex earned 200 total points
ID: 1091745
Just have a look into the SQL-help .)

SET ROWCOUNT 100
SELECT * FROM TABLE

Will limit the returned rows to 100


0
 

Author Comment

by:gljsentvid16
ID: 1091746
Not working, I'm using InterBase SQL server!
0
 
LVL 2

Expert Comment

by:connex
ID: 1091747
Hmm well then I cant help you other, than suggesting using count (like you tried already), as I don't know anything about the IB SQL, sorry. Just reject my answer, and maybe state such things in your question next time.

0
 
LVL 1

Expert Comment

by:mativare
ID: 1091748
Try
Select Top 100 from mytable
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question