Oracle Select * returns rows but Select count(1) return 0
<p>So, this is bizarre and it's something I have never seen before. I'm hoping someone has the magic answer that can shed some light on this problem...</p>

<pre><code>SELECT * FROM TABLE -- returns rows... a lot of rows
</code></pre>

<p>however,</p>

<pre><code>SELECT COUNT(1) FROM TABLE -- returns zero (0), as in the number zero (0) as the result
</code></pre>

<p>Here's the table structure:</p>

<pre><code>CREATE TABLE TRACKING (
  A_ID NUMBER,
  D_CODE NUMBER,
  HOD NUMBER,
  ADR_CNT NUMBER,
  TTL_CNT NUMBER,
  CREATED DATE,
  MODIFIED DATE
);
CREATE INDEX HOD_D_CODE_IDX ON TRACKING (HOD, D_CODE);
CREATE UNIQUE INDEX TRACKING_PK ON TRACKING (A_ID, D_CODE, HOD);
CREATE INDEX MOD_DATE_IDX ON TRACKING (MODIFIED);
ALTER TABLE TRACKING ADD CONSTRAINT TRACKING_PK PRIMARY KEY (A_ID, D_CODE, HOD);
</code></pre>

<p>How can an Oracle table have rows but count(1) return zero? I've done some searching on the web but found nothing. The only other post I found was in relation to MS SQL Server. This is happening in Oracle.</p>

<p>Any idea? Anyone?</p>

<p>Thank you in advance for any help you can provide.</p>

<p>Another thing I might add in hopes that it will help answer the puzzle, this table was used by an Oracle Job to aggregate and populate another table. However, it's been done for a few days now. The other table is fully populated and shows expected record counts. I checked the Oracle Job Log and it shows all success and not a single error.</p>