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!

Append a string to the Last record

630050Jun 22 2012 — edited Jun 22 2012
Hi,
I was just trying to format an o/p of a table, and while looking at the result I thought it would be nice to append a peice of a String to the last record. For example
with dat as (
select 'First Record' as COL from DUAL
union all
select 'Second Record'  from DUAL
union all
select 'Third Record'  from DUAL
union all
select 'Nth Record'  from DUAL )
select * from dat

o/p                                             Desired o/p
COL                                            COL            
-------------                                 -------------
first RECORD                             first RECORD
second RECORD                            second RECORD  
THIRD RECORD                            THIRD RECORD 
NTH RECORD                             This is the last record NTH RECORD   
This post has been answered by Purvesh K on Jun 22 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 20 2012
Added on Jun 22 2012
10 comments
489 views