View previous topic :: View next topic
|
Author |
Message |
adarsh.bhalke
New User
Joined: 06 May 2007 Posts: 16 Location: pune
|
|
|
|
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 |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
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 |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Try COUNT_BIG(*) instead of COUNT(*)! |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Did you get a resolution for this? |
|
Back to top |
|
|
TMOORE
New User
Joined: 08 Feb 2008 Posts: 4 Location: Macon Georgia
|
|
|
|
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 |
|
|
|