Database Administration (MOSC)

MOSC Banner

Mis-Matched number of rows inserted in a table

edited Aug 1, 2012 4:42AM in Database Administration (MOSC) 2 commentsAnswered
Hi Guys,

DB=10.2.0.4
OS = RHEL AS 4, 32 bit

The following query returns ..1940782  rows for 'YESTERDAY'.

SQL> Select COUNT(*) MessageCount, trunc(sysdate -1) DAY from DeviceTravelStatusHistory dtsh
where dtsh.locationtime >= to_date(to_char(sysdate-1, 'YYYY-MM-DD'), 'YYYY-MM-DD');  2

MESSAGECOUNT DAY
------------ ---------
     1940782 31-JUL-12

But, When I tried to insert these rows into another temporary table, it shows only - 17023 rows created. Here is the insert query im using..

insert /*+ APPEND */ into RPTDBA.MESSAGE_METRICS(DEVICEINSTANCEGUID,AVLMSGCOUNT,DAY)
Select dtsh.deviceinstanceguid, COUNT(*) MessageCount, trunc(sysdate -1) DAY from DeviceTravelStatusHistory dtsh 
where dtsh.locationtime >= to_date(to_char(sysdate-1, 'YYYY-MM-DD'), 'YYYY-MM-DD') group by dtsh.deviceinstanceguid;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center