Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Problem in COUNT(*) to count the no of rows present

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
adarsh.bhalke

New User


Joined: 06 May 2007
Posts: 16
Location: pune

PostPosted: Thu Feb 07, 2008 1:12 pm    Post subject: Problem in COUNT(*) to count the no of rows present
Reply with quote

Hi All,

I have i am using the following query in order to count the no of rows present in the table

SELECT COUNT(*) FROM A.EMP

Its returning me a value X.

But if i use the folloing query

SELECT COUNT(*) FROM A.EMP WHERE A_CO = '01'

then this should give me a value either X or less than X.

But the second query is giving me the count which is four times that the first one.

Note: My table contains HUGE no of records.

Please let me ans fot this
Back to top
View user's profile Send private message

agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Thu Feb 07, 2008 1:51 pm    Post subject:
Reply with quote

small question- are you running both the queries against same subsystem?
Sometimes I tend to do mistake of running SPUFI against table one region and program plan runs the query against table in some different region with same name.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Feb 07, 2008 6:45 pm    Post subject:
Reply with quote

Try COUNT_BIG(*) instead of COUNT(*)!
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Sat Feb 09, 2008 12:54 am    Post subject:
Reply with quote

Did you get a resolution for this?
Back to top
View user's profile Send private message
TMOORE

New User


Joined: 08 Feb 2008
Posts: 4
Location: Macon Georgia

PostPosted: Sat Feb 09, 2008 2:27 am    Post subject:
Reply with quote

Although rare, I have had a corrupted index cause this condition once before. When the predicate is indexable using the corrupted index, you get an incorrect answer.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts sending email from jcl using the mail... niloyarp JCL & VSAM 5 Tue Oct 10, 2017 12:32 pm
No new posts Conditional highlighting of rows in I... packerm CLIST & REXX 2 Thu Sep 21, 2017 6:50 pm
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us