Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

get data in report

User_AC3QEJun 18 2021
Hi
I need to create a report that displays from the dt_lanc field controlling by fields (seq, attend ) repeat the data until you have a new seq for a more recent date.

--create table
CREATE TABLE dados (
seq    number(10) not null,
atend number(10) not null,
pac varchar(255),
dt_lanc date,
dados varchar(255));

--insert
Insert into dados (seq,atend,pac,dt_lanc,dados) values (1,10,'dados',sysdate,'Manha');
Insert into dados (seq,atend,pac,dt_lanc,dados) values (2,10,'dados',sysdate+4,'Tarde');

--data
select seq, 
       atend, 
       pac, 
       to_char(dt_lanc,'dd/mm/yyyy') as dt,
       dados 
from dados;

<img src="https://objectstorage.us-phoenix-1.oraclecloud.com/p/BqK85Rn1zA5MP0vYiqbAdPgs7Z6OmMxw8SD3WCFVm5kY8uReidZ1KPIKkgJ1hCkG/n/axciphqpnohg/b/forums-legacy/o/uploads/URQ06OIC0GJG/image.png" alt="image.png">


I need you to repeat the data from the first row per day until the next seq that has a new date


Example:
<img src="https://objectstorage.us-phoenix-1.oraclecloud.com/p/BqK85Rn1zA5MP0vYiqbAdPgs7Z6OmMxw8SD3WCFVm5kY8uReidZ1KPIKkgJ1hCkG/n/axciphqpnohg/b/forums-legacy/o/uploads/VR1YG9XUPRFQ/image.png" alt="image.png">


This post has been answered by Frank Kulash on Jun 18 2021
Jump to Answer
Comments
Post Details
Added on Jun 18 2021
11 comments
153 views