Home » SQL & PL/SQL » SQL & PL/SQL » Fill in records where date missing in sequence (Oracle 12c, Querying with SQL Developer v3.2.20.10)
icon5.gif  Fill in records where date missing in sequence [message #679814] Tue, 31 March 2020 17:12 Go to next message
sqlafterdark
Messages: 1
Registered: March 2020
Junior Member
I am relatively new to plsql. I have a fairly complex query that is pulling both header and line data from a few source tables. In the header, there is a StartDate field, and on the lines there is a DeliveredDate field. I need to loop my query to create records for any dates that might be missing between the StartDate and the current date. I want to copy over any info from the header in these new fields and blank/zero out the other fields.

I attached a sample of the data output. Query currently returns the non-highlighted records, the yellow records are the ones I need to get added. Assume header StartDate=3/11/2020

Re: Fill in records where date missing in sequence [message #679815 is a reply to message #679814] Tue, 31 March 2020 23:43 Go to previous message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Welcome to the forum.
Please read the OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.

Align the columns in result.
Also always post your Oracle version, with 4 decimals (query v$version), as often solution depends on it.

With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

Previous Topic: Alter Regex to validate email Domain on RFC 5322 from Java to Oracle sql
Next Topic: How To Add Full Email Body Text from File to CLOB Column?
Goto Forum:
  


Current Time: Thu Mar 28 17:52:44 CDT 2024