Skip to Main Content

SQLcl: MCP Server & SQL Prompt

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!

Need help in sql!

BenyaminiDec 7 2016 — edited Dec 13 2016

I split one row from a table as below result

T;TDC;;;;;;009990972498000

D;AA209;;;ETX;;;;;;8058;0;

A;AA;080;;;;;;8058;0;

E;1;20150826

T;TDC;;;;;;009990972498000

D;DD102;;;ETX;;;;;;13428;0;

A;DD;080;;;;;;13428;0;

E;1;20150826

T;TDC;;;;;;009990972498000

D;DD405;;;ETX;;;;;;319;0;

A;DD;080;;;;;;319;0;

E;1;20150826

T is the header and E is the footer, D and A are details line.

Now that T and E are repetitive i wanted to eliminate duplicate headers and footers taking care of the existing order to have the result as follows;

T;TDC;;;;;;009990972498000

D;AA209;;;ETX;;;;;;8058;0;

A;AA;080;;;;;;8058;0;

D;DD102;;;ETX;;;;;;13428;0;

A;DD;080;;;;;;13428;0;

D;DD405;;;ETX;;;;;;319;0;

A;DD;080;;;;;;319;0;

E;1;20150826

Can somebody help?

I will appreciate

Comments
Post Details
Added on Dec 7 2016
8 comments
393 views