Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 6th, 2012, 05:22 PM
sourabh.asu sourabh.asu is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 2 sourabh.asu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 29 m 49 sec
Reputation Power: 0
Insert into table when data missing

Hello,
I have the following table, for readability I broke down the after every manager for every case number. The last column is the cumulative sum of the second last column. Value for month should ideally run from 1-3 (Like you see for both the cases for Chicago). But from the table you can see in some cases some entries are missing (marked by <-----).

CITY CASE CASE_NUMBER MANAGER MONTH MONTHLY_TOTAL FISCAL_TOTAL
---------------------------------------------------------------------------
chicago case_1 1 John 1 2 2
chicago case_1 1 John 2 3 5
chicago case_1 1 John 3 5 10

chicago case_1 1 Jeff 1 4 4
chicago case_1 1 Jeff 2 2 6
chicago case_1 1 Jeff 3 3 9

chicago case_2 2 John 1 3 3
chicago case_2 2 John 2 2 5
chicago case_2 2 John 3 4 9

chicago case_2 2 Jeff 1 2 2
chicago case_2 2 Jeff 2 7 9 <----

newyork case_1 1 Lee 1 3 3
newyork case_1 1 Lee 2 4 7 <----

newyork case_1 1 Sue 1 2 2
newyork case_1 1 Sue 2 3 5
newyork case_1 1 Sue 3 2 7

newyork case_1 2 Lee 1 2 2
newyork case_1 2 Lee 2 4 6
newyork case_1 2 Lee 3 4 10

newyork case_1 2 Sue 1 3 3
newyork case_1 2 Sue 2 2 5 <----


What I want is to first find out those missing rows and insert values. For those missing ones monthly_total = 0
fiscal_total = value in previous row. E.g. for first missing row it should be:

CITY CASE CASE_NUMBER MANAGER MONTH MONTHLY_TOTAL FISCAL_TOTAL
---------------------------------------------------------------------------
chicago case_2 2 Jeff 3 0 9

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Insert into table when data missing

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap