View previous topic :: View next topic |
Author |
Message |
karthikeyan Beginner

Joined: 29 May 2004 Posts: 16 Topics: 4 Location: chennai
|
Posted: Sun Aug 06, 2006 7:41 pm Post subject: How to Fetch a row only if the table contains more than 100? |
|
|
The requirement is to fetch a row in a table only if the table contains more than 100 rows.
Note : The Query should not be tried with the Count operator |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Sun Aug 06, 2006 7:56 pm Post subject: |
|
|
Quote: |
Note : The Query should not be tried with the Count operator
|
karthikeyan,
Who came up with such a *Brilliant* idea ?
Is this a real requirement ?
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
karthikeyan Beginner

Joined: 29 May 2004 Posts: 16 Topics: 4 Location: chennai
|
Posted: Mon Aug 07, 2006 12:28 am Post subject: |
|
|
Kolusu
Is there a possibility to do it with a Row ID ?
Karthik |
|
Back to top |
|
 |
videlord Beginner
Joined: 09 Dec 2004 Posts: 147 Topics: 19
|
Posted: Mon Aug 07, 2006 4:57 pm Post subject: |
|
|
Row ID is an internal format, not related to row number.
If you don't want to use COUNT function, try this
1. run RUNSTATS utility on this tablespace
2. get the value of CARDF from catalog table SYSIBM.SYSTABLES, it's the number of rows when the unitily run.
3. fetch or not depend on the value.... |
|
Back to top |
|
 |
|
|