Solved

How to limit how many rows I wish to get

Posted on 1998-07-14
4
173 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

685 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