Home » SQL & PL/SQL » SQL & PL/SQL » how to display the values with prefix increment? (Oracle)
how to display the values with prefix increment? [message #680641] Thu, 28 May 2020 07:03 Go to next message
ramanajak
Messages: 1
Registered: November 2008
Location: hyderabad
Junior Member

please help to display as below format

col1 col2
Load L001
Load L002
Disc D001
Disc D002
Load L003
Disc D003
Re: how to display the values with prefix increment? [message #680642 is a reply to message #680641] Thu, 28 May 2020 08:14 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Welcome to this forum

Please read and follow the forum guidelines, to enable us to help you:
OraFAQ Forum Guide
How to use {code} tags and make your code easier to read
Re: how to display the values with prefix increment? [message #680643 is a reply to message #680642] Thu, 28 May 2020 08:16 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
https://community.oracle.com/thread/4332212
Re: how to display the values with prefix increment? [message #680644 is a reply to message #680641] Thu, 28 May 2020 09:24 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.
Indent the code, use code tags and 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.

Solution to your problem:
SQL> select 'col1 col2
  2  Load L001
  3  Load L002
  4  Disc D001
  5  Disc D002
  6  Load L003
  7  Disc D003'
  8  from dual;
col1 col2
Load L001
Load L002
Disc D001
Disc D002
Load L003
Disc D003
Previous Topic: UTL_MAIL vs UTL_SMTP sending CLOB body
Next Topic: oracle -rearrange columns values based on value type
Goto Forum:
  


Current Time: Fri Mar 29 09:05:29 CDT 2024