How do to convert two points separated in several lines in the report, the column values

Hi all

I want to display two separate points of values in a column, in a row of multi in report.

For example I have a Column1 in an array with the value 'A', column2 has the value "1".

I want to show in a report of three lines using these two columns as

Column1 Column2
A 1
B 1
A s

Here's one way:

SQL> create table test (col1 varchar2(20), col2 number);

Table created.

SQL> insert all
  2    into test values ('A:B:C', 1)
  3    into test values ('Dg:Ezs', 2)
  4  select * from dual;

2 rows created.

SQL> select
  2    t.col2,
  3    regexp_substr(t.col1, '\w+', 1, t2.column_value) c1
  4  from test t,
  5    table(cast(multiset(select level
  6                        from dual
  7                        connect by level <= length(t.col1) - length(replace(t.col1, ':', '')) + 1
  8                       ) as sys.odcinumberlist )) t2
  9  order by 2, 1;

      COL2 C1
---------- --------------------
         1 A
         1 B
         1 C
         2 Dg
         2 Ezs

SQL>

Published by: little-foot 31 January 2012 10:13

Tags: Database

Similar Questions

  • Convert the column values into buckets

    Hello

    Please help me to convert the column values into buckets.
    I have the values of the columns in the following way.


    Age of Orderdate * 9 10 12 14 15 18 19 20 21 22 26 27 28 29 33 34 40 45 * and so on



    But the requirement is the column values should be displayed in form

    Age by order date * 15 1 2 3 4 5 6 7 8 9 10 11 - 16-20 21-25, 26-30 30 + *.


    Please someone give me the solution.

    Thanks in advance.

    Hervé Rama

    Hi Richard,

    Just to double check, you have Setup buckets for 1, 2, 3, 4, 5, 6, 7 and 8 individually (each with a fair value). The problem is that you simply do not have all data fall into buckets above, correct?

    If this is the case, it looks like has been answered your original question. If so, the label would assign 'Proper' points by clicking on the button label correct next to the appropriate response and open a new thread with your new question. The reason why I say this is it will help other people who have a similar bucket question to your solution, without complicating the issue with subsequent questions.

    If you can post a separate thread, I'd be more than happy to help you with your secondary problem.

    Best regards

    -Joe

  • convert the column values to a single line...

    I have to return the column values to a single line separated by commas.
    If the nulls in the column just ignore without a comma.
    Here is one for example. There are three values and two NULL values in the table
    SQL> select ID from temp_fa;
    ID
    -----
    
             1
             2
    
             3
    
             5
    
    6 rows selected.
    
    
    I am expecting an output as 1,2,3,5
    Help, please

    There is always more than one title in the Oracle world ;)
    You can use the TRIM, for example (same configuration as your example):

    hoek&XE>  create table t as select level col  from dual connect by level <= 6;
    
    Tabel is aangemaakt.
    
    hoek&XE> update t set col = null where col in (1,3,5);
    
    3 rijen zijn bijgewerkt.
    
    hoek&XE> select * from t;
    
           COL
    ----------
    
             2
    
             4
    
             6
    
    6 rijen zijn geselecteerd.
    
    hoek&XE> select ltrim(sys_connect_by_path(col, ','), ',') output
      2  from  ( select col
      3          ,      row_number() over (order by col) rn
      4          from   t
      5        )
      6  where connect_by_isleaf=1
      7  start with rn=1
      8  connect by rn = prior rn+1;
    
    OUTPUT
    -------------------------------------------------------------------------------------------------------------
    2,4,6,,,
    
    1 rij is geselecteerd.
    
    hoek&XE> select trim ( both ',' from sys_connect_by_path(col, ',')) output
      2  from  ( select col
      3          ,      row_number() over (order by col) rn
      4          from   t
      5        )
      6  where connect_by_isleaf=1
      7  start with rn=1
      8  connect by rn = prior rn+1;
    
    OUTPUT
    -------------------------------------------------------------------------------------------------------------
    2,4,6
    
    1 rij is geselecteerd.
    
  • How to query start a new line in the column?

    How to query start a new line in the column?

    Exam

    SELECT ID, username | host name, details of xxx;

    on the 2 column, I need result below:

    Username ID | hostname in detail
    1 user1 xxxxxx
    host1
    2 user2 xxxxxx
    host2

    Kind regards
    Suradech

    Something like that?

    SQL> WITH tbl AS (SELECT 1 id,'user1' uname,'xxx' dtl,'host1' hname FROM DUAL UNION ALL
      2               SELECT 2 id,'user2' uname,'yyy' dtl,'host2' hname FROM DUAL UNION ALL
      3               SELECT 3 id,'user3' uname,'zzz' dtl,'host3' hname FROM DUAL
      4               )
      5  SELECT id,uname||dtl||chr(10)||hname FROM tbl;
    
            ID UNAME||DTL||CH
    ---------- --------------
             1 user1xxx
               host1
    
             2 user2yyy
               host2
    
             3 user3zzz
               host3
    
  • How can I add two pages just before page 7 of the book, which will change all the page numbers that follow?

    Hello

    I'm close to finishing a book of 257 pages.  All pages are numbered automatically down, and I spent a few weeks carefully constructed an Index at the end of the book that has all the right page numbers listed for everything.  So whatever I do, I can't change my page numbers.

    But at this late stage, I would like to add a few epigraphs (quotations) in four or five places (I just got this idea today, I'm afraid).

    Is it possible to add a few pages here and there (I will add two pages at a time, I know, or he'll hit all the pages that follow, half of them designed to be left, and half designed to be on the right - off) that are not numbered, and that will not affect the numbering of the following pages?

    Kind regards

    Malcolm

    It is not Automatic way. If you are ready to have unnumbered pages which are not included in the number of pages, you can, for each page the inserted value

    (1) select the first page after the pages will be added

    (2) in the menu pages palette, use the Options Section and number and the page number of started with the value what it is already. In this way, adding pages will not affect the numbering.

    (3) in order to avoid conflicts with the new pages page number, set their numbering on something else as 1,2,3. (as i, ii, iii, for example)

    For later use, you can configure your index with the indexing of InDesign tools, if a false problem, as you would have been able to add the pages and then re - automatically generate a correct index.

  • How to make a graphic inside a while loop to maintain the previous values

    At first I tried to use a the VI Express XY graphics to create a track of points.  However, the chart is a trace linear between the first point in the new line and the last point of the previous line.  It then creates the new line as you wish.

    I tried to use a loop with group a cluster for the chart, but the chart resets the plot at each iteration (as expected) and I can't find a way to maintain the previous data.  I tried using shift registers, but was unable to find a way to do it, and I tried also the cluster of a painting company, but can not find a way to make the cluster to a 1 d of a cluster of 2 elements array.

    One option is to have is to find a way to maintain the previous data, but the preferred option is to create a new path to each iteration to see the color change for each new parcel.

    I take stabbed it because I don't know exactly what you want. But I think that's what I've shown here. You must use a shift on your outside register while loop, as I showed. Your image where you tried to use a shift register shows a misunderstanding of the shift registers and how well they work, then I'd take a peek at these tutorials.

  • Point size of a paragraph indicating the different value in the definition

    Hello!

    I have two paragraphs on a page of my InDesign document. The size of the text of the two of them is 18pts. On the via the script, when I access the pointSize field in the two paragraphs (paragraph points pointSize object), it now returns 18.

    But if I check in via para.appliedParagraphStyle.pointSize, he returned to 38.

    Anyone could explain this behavior, or what fundamental error that I do?

    See fly the answer of the day here-

    Place multiple images in a container (rectangle, oval, polygon)

  • Exaprom PDF: how cells that can cover several lines in the body of the table?

    I use Exaprom PDF but I have a case that I can't work.

    I would like to generate a table where a cell spans an entire line in the body of the table, the table should be translated as:

    ____________

    |__|__|__|__|

    |__|__|__|__|

    |___________|

    |__|__|__|__|

    Dear Marc,

    could you post an example how span a cell of an entire row in the table with the function body "Append custom Table.vi."

    For example, please use the 2009 version.

    Thank you

    Asper

    This message refers to the report Exaprom PDF generation tool:

    https://decibel.NI.com/content/docs/doc-10952

    Perhaps this.

  • How can I get a SpryMenuBar update of several pages of the site changes?

    I'm a relatively new Web site builder. I'm building a site in CS5 that will initially have about 10 to 20 pages, but constantly expand.

    How can I have my SpryMenuBar changes feed to all of the pages on my site? I think I need to do something with the external css styles, but I can't understand it.

    I used a template to create additional pages.

    Thank you

    Joshua

    Hello

    the new bad first: SPRY is outdated and is no longer officially supported by Adobe. (SPRY for example will not work on any touch screen.) So I / we recommend that you switch to a library jQuery for your other needs.

    The good news: while brégent wrote you can use SSI directives. For this, David Powers made a great "recipe book". Still (!) you can find it:

    http://foundationphp.com/tutorials/sprymenu/ssi.php.

    Good luck!

    Hans-Günter

  • Several lines to a format of columns from two tables

    Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production

    The difficulty to return several lines simple lines/columns in two tables.

    Table 1:

    ID BOOK_NBR
    1 1001
    1 2001
    2 1010
    3 1020

    Table 2:

    AUTHOR BOOK_NBR
    1001 JOHN_1
    2001 JOHN_2
    MARY 1010
    1020 JUNE


    Desired output:

    ID BOOK_NBR AUTHOR BOOK_NBR AUTHOR
    1 1001 JOHN_1 2001 JOHN_2
    2 MARY 1010
    3-1020 JUNE


    There are an unknown number of BOOK_NBR to one ID.

    Any guidance would be appreciated.
  • Two lines with the same value (in a single pass) but a different value (in another pass)...

    Hello
    I have the following table:
    create the table pp_status (ppid number (10), ppdescr varchar2 (20),)
    (1) number, varchar2 (4)) bordered;
    The ppid is the primary key.

    where: the ppid Gets the values of a sequence, status may have values (0, 1, 2) and bordered of... years.
    Thus, some values of line may be as follows:
    insert into pp_status values(1,'XX',0,'2009');
    insert into pp_status values(2,'XXY',0,'2010');
    insert into pp_status values(3,'XXT',1,'2009');
    .....

    Now, I want to impose a business rule in which declaratively:
    If and only if both lines have values of shell (as in row 1, 3 in the example above lines) but different data values in the neck of status (and specifically the values 0 and 1 (not 2), as in the lines of the sample 1 and 3) then the second row (that is, the third row in the whole of the sample) is permitted , otherwise not. For example, the following lines:
    insert into pp_status values(3,'XXT',2,'2009'); {because of the whole first line was inserted}
    insert into pp_status values(3,'XXT',0,'2009'); {because of the whole first line was inserted}

    should not be allowed...

    Is it possible to achieve without writing code... I mean the declaratively.

    Note: I use DB10g v.2

    Thank you
    SIM

    SIM,

    It's an interesting challenge, which requires two unique indexes to solve declaratively:

    SQL> create table pp_status(ppid number(10),ppdescr varchar2(20),
      2  status number(1) check (status in (0,1,2)),firstyear varchar2(4));
    
    Tabel is aangemaakt.
    
    SQL> create unique index ui1 on pp_status (firstyear,decode(status,2,0,status))
      2  /
    
    Index is aangemaakt.
    
    SQL> create unique index ui2 on pp_status (firstyear,decode(status,2,1,status))
      2  /
    
    Index is aangemaakt.
    
    SQL> insert into pp_status values(1,'XX',0,'2009');
    
    1 rij is aangemaakt.
    
    SQL> insert into pp_status values(2,'XXY',0,'2010');
    
    1 rij is aangemaakt.
    
    SQL> commit
      2  /
    
    Commit is voltooid.
    
    SQL> insert into pp_status values(3,'XXT',2,'2009');
    insert into pp_status values(3,'XXT',2,'2009')
    *
    FOUT in regel 1:
    .ORA-00001: Schending van UNIQUE-beperking (RWIJK.UI1).
    
    SQL> insert into pp_status values(3,'XXT',0,'2009');
    insert into pp_status values(3,'XXT',0,'2009')
    *
    FOUT in regel 1:
    .ORA-00001: Schending van UNIQUE-beperking (RWIJK.UI1).
    
    SQL> insert into pp_status values(3,'XXT',1,'2009');
    
    1 rij is aangemaakt.
    

    Kind regards
    Rob.

    PS: why the hell proclaim the year varchar2 (4) instead of number 4?

  • How to get the values of two points separated in Javascript checkbox

    Hello

    I want to get the values of an element of the checkbox as a form of separted from the colon as what we get in the database. For example '10:11:12 '.

    When I tried to write a code like this it does not work. Please tell me where I'm wrong.


    function getValues (pcheckbox) {}
    cb_name = html_GetElement(pcheckbox+'_0').name;
    cb_array = document.getElementByName (cb_name);
    var val_str =': ';
    for (i = 0; i < cb_array.length; i ++)
    {
    If (cb_arraychecked)
    {
    val_str += cb_array [i] .value + ':';
    }
    }
    html_GetElement (P206_TEXT) .value = val_str;
    }



    I try to call the function getValues ('P206_CHECK');

    Thank you and best regards,
    Vikas Krishna

    Hi Vikas,

    Try this-

    (1) create a checkbox element called PI_CHK
    (2) in the Option of the attributes of the form element, type onclick = "getValues () '"
    (3) create a named text field point PI_TEXT

    Enter the HTML of the Page Header Section

    
    

    Concerning

    Paul

  • How to configure two windows separated from direct mail on the PC user accounts, each with their own password

    The purpose of running two separate is Windows Live Mail accounts to have total privacy on each, avoiding different users can see other accounts or e-mail folders. I don't want to mix the different user accounts when the opening of windows live mail, each user must be able to open his account separately.

    Thxs

    While this was possible with Outlook and Outlook Express identities as this function is not available with Windows Live Mail as detailed here

    Basically, it says to put in place of the separate accounts for each user to connect to Windows to isolate the e-mail accounts in each of the other opinions.

    On the only other option is to use some use webmail ISP provides you instead of Live Mail.

  • How can I open two documents separated into two screens?

    I can't hav

    I use to be able to see the two documents open at the same time Add.  He won't let me since I've updated.

    Hi ljesmok,

    The documents could open in different tabs.

    If you want to open in different screens, then please uncheck 'Open documents in the new tab' under ' Edit > Preferences > general.

    Hope that helps.

    Kind regards

    Ana Maria

  • How can I create a point centered on a line of text?

    I want to create a bullet, not a point of the bullet, a string of text. How can I do?

    "Centered" with respect to what?

    This • works for you? From the keyboard, press option-8.

    Kind regards

    Barry

Maybe you are looking for

  • Reinstallation of HP Support Assistant

    Hello HP Pavilion dv7-1245dx (Win 7-64 bit) Am having problems with the HP software on my laptop: I try to reinstall the latest version of the HP Support assistant on the HP site but get error messages and an unsuccessful installation or uninstall. 1

  • Ways to recharge the pencil of Apple?

    Technical support of Apple, 'use Apple pencil with iPad Pro' article mentions, "You can also plug into a USB port with the pencil of Apple adapter and a USB charge cable Flash." You can also connect your pencil directly on your iPad charge cable (con

  • Satellite A200 - 10 X - the white lines on the screen

    Hey I have a problem with my laptop, it's a Satellite A200-10 X, with Vista Home Premium and in recent weeks, my monitor has taken a turn for the worse.Well, there are these white lines from one side to the other, at the bottom of the screen and they

  • SATA III

    I want to buy a computer HP Envy, but I want him to have at least a SATA III. Combing through the specs I can only find standard sata drives. Does anyone know if a model of this type, or indeed any other HP computer can be activated with a SATA III.

  • How to reset file associations?

    You cannot change the configuration of the everything is on in adobe reader, how to reset origional Setup. I'm unable to use the programs. that's happened?