How do for lines double in the outbuildings of columns

Hello

I have a table like this:

ID customer date_01 date_02 date_03 date_04

-----------------------------------------------------------------------------------------------------

1 Smith, Peter 01/01/2000 03/28/2001 12/01/2002 09/13/2004

2 Miller, John 09/12/2004

3 Brown, Steve 03/11/2009-12/12/2010

4 Hanson, Pete

I need a query that returns a set of results as follows:

id                              date

---------------------------------------------------------------------------

1 Smith, Peter 01/01/2000

1 Smith, Peter 28/03/2001

1 Smith, Peter 01/12/2002
1 Smith, Peter 13/09/2004

2 Miller, John 09/12/2004

3 Brown, Steve 11/03/2009

3 Brown, Steve 12/12/2010

If all columns date (date_01 to date_04) have the value NULL, then the line should appear not at all. The lines should get duplicated in the dependence of the amount of filled DATE columns

(date_01 to date_04).

I use Oracle 10 g - any help will be appreciated.

Rgds

J.

In 10g...

WITH qry1 AS

(SELECT 1 id, 'Smith, Peter' customer, TO_DATE('01/01/2000','MM/DD/YYYY') date_01, TO_DATE('03/28/2001','MM/DD/YYYY') date_02, TO_DATE('12/01/2002','MM/DD/YYYY') date_03, TO_DATE('09/13/2004','MM/DD/YYYY') date_04 OF DOUBLE UNION ALL)

SELECT 2, 'Miller, John', TO_DATE (December 9, 2004 "," MM/DD/YYYY ""), NULL, NULL, NULL FROM DUAL UNION ALL

SELECT 3, 'Brown, Steve', TO_DATE (March 11, 2009 "," MM/DD/YYYY ""), TO_DATE (12 December 2010 "," MM/DD/YYYY"), NULL, NULL FROM DUAL UNION ALL

SELECT 4, "Hanson, Pete", NULL, NULL, NULL, NULL FROM THE DOUBLE)

SELECT *.

Of

(SELECT id,

customer,

CASE WHEN lvl = 1 THEN date_01

ONCE lvl = 2 THEN date_02

ONCE lvl = 3 THEN date_03

ONCE lvl = 4 THEN date_04

END dates

OF qry1, (SELECT LEVEL lvl

OF the double

CONNECT BY LEVEL<>

)

WHERE the dates IS NOT NULL

ORDER BY 1;

OUTPUT:-

=======

Smith, Peter 1 January 1 00

1 Smith, Peter 28 March 01

1 Smith, Peter 1 December 02

1 Smith, Peter SEPT. 13.-04

2 Miller, John December 9 04

3 Brown, Steve 12 December 10

3 Brown, Steve 11 March 09

Thank you

Ann

Tags: Database

Similar Questions

  • DR IP customizer: error on line number '17': the number of columns specified is incorrect.

    Hello

    I work with MRS 4.1 and trying to customizations ip configuration for my virtual machines guests on the recovering site (approx. 100 guests).  I've updated the CSV (generated from the order of Dr. - ip - customizer.exe) with all the necessary network information.  But when I try and upload it to my site SRM recovery server, I get the following error:

    Error on line number '17': the number of columns specified is incorrect.

    Is the command I use to download: Dr. - ip - customizer.exe - cfg... create csv - c:\srmip.csv - cmd \config\vmware-Dr.xml

    I found that if I change the csv file so that it contains 16 lines or less it downloads very well.  I have not read on any limitation of the number of rows in the csv file might contain so I think that there is a configuration that causes this behavior, but I can't figure out what that/where it is.  Any help would be greatly appreciated.

    Thank you.

    Hello

    something is wrong with your file formatting. A look at the image as an attachment. From the server6 (line 17) do not have the lines "," (comma) at the end of the line (and so less columns):

    If I take your file and then open in Excel and save it without changing anything, all lines have ',' (comma).

    Probably something wrong with the way in which you save the files (Excel throws several warnings when you try to save the file in the csv format, you have to press 'Yes').

    Michael.

  • How to create line breaks in the argument cftextarea, format = flash

    I use < cfform format = "flash" >, and I can't understand how to create a linebreak in the form argument cftextarea control. For example, in the following code, I would display "item1", "item2" and "item3" on separate lines. I'm new to cfform and flash tags, so any help would be greatly appreciated!

    < name of the argument cftextarea = "impacted_systems."
    label = "affected systems.
    ReadOnly = 'yes '.
    height = "24".
    Width = "300".
    Wrap = "virtual" > < cfoutput > topic 1, item2, item3 < / cfoutput > < / argument cftextarea >

    Try #chr (13) # between your objects


    label = "affected systems.
    ReadOnly = 'yes '.
    height = "48".
    Width = "300".
    Wrap = "virtual" >item 1, #chr (13) #item2, #chr #item3 (13)

  • How to increase line spacing between the tree of elements in a modern tree control

    I have a VI where I used a tree of modern pallate control, that I need to increase the space between the elements of the tree. and should be retained, even if I have to add or remove items from the tree

    PS: Property "AutoRowHt" doesn't seem to help here

    Unfortunately, I didn't have time to play with or not this propgates of new entries created in the control tree programmatically, but if not, you could always just to revive this section of code (or specify the specific line because you'll know that the index of the inserted item).

    Specification-2 in the number of line property will specify that the change should be made for all rows in the tree.

  • How do for elements to create the shuttle cascading in Oracle Apex

    Can everyone please create me Articles of the shuttle in cascade in the oracle apex.

    The same way as you do that for selection only lists the condition is a little different. Here is an example of the second Shuttle in my case:

    SELECT pcat_title d, pcat_id r

    FROM (SELECT pcat_id, pcat_title, pcat_pt_code

    Of om_prod_categories

    WHERE pcat_parent_id IS NULL)

    WHERE INSTR (': ' |: p3_prod_pt_code |) ':',

    ':' || pcat_pt_code | ':') > 0

    Denes Kubicek

  • change the color of line based on the value of column 5 Apex in the classic report

    Version of the apex 5.0.0.00.31

    Standard universal theme

    Page theme default template

    Classic report

    Foldable report template

    Hello

    I know this question has been asked several times here, but I'm working on 5 Apex and need to know the correct way to do it in this version.

    I need to change the color of the text of the entire line (no background color) based on the value in one of the columns of the classic report. I have just two conditions, if the value of column = Yes, color should be red, otherwise it must be green.

    I am new to jscript and css, so appreciate if someone can tell me the solution with steps.

    I have already checked this link that changes the value of the column, need to do something similar to the whole line.

    https://tylermuth.WordPress.com/2007/12/01/conditional-column-formatting-in-apex/

    Hi coolmaddy007-Oracle,.

    Here's an example set up on the apex.oracle.com according to the specifications you gave: https://apex.oracle.com/pls/apex/f?p=35467:1

    Version of the apex 5.0.0.00.31

    Standard universal theme

    Page theme default template

    Classic report

    Foldable report template

    Here is how it is done:

    Create a dynamic action with the following specifications:

    Name: Give the appropriate name

    Event: After refresh

    Selection type: region

    Region: select your region classic report

    Condition: No strings attached

    Action: Run the JavaScript Code

    Fire on loading the Page: Yes

    Code:

    $('td[headers="JOB"]').each(function() {
      if ( $(this).text() === 'MANAGER' ) {
        $(this).closest('tr').find('td').css({"color":"red"});
      }
      if ( $(this).text() === 'SALESMAN' ) {
        $(this).closest('tr').find('td').css({"color":"green"});
      }
      if ( $(this).text() === 'CLERK' ) {
        $(this).closest('tr').find('td').css({"color":"blue"});
      }
    });
    

    NOTE: Download the selector appropriate for your knowledge $('td[headers="JOB"]') case using firebug/browser development tools.

    Items concerned: leave blank.

    PS: Changed the example to change the color of text instead of the background color.

    I hope this helps!

    Kind regards

    Kiran

  • How to ensure that the value of a control (for example double) initializes the last value when the VI has been closed?

    I use a cluster as a control. I would like to double in this control to automoatically values to fill their last values set when the VI is opened or accessed for the first time. It would be great if someone could point out for me. Thanks in advance!

    In my opinion, the configuration files are the easiest method and the best.  Simply save your last values to the file when your code ends.  At the beginning of your code, to read the file and fill in the controls with the values read.  With the configuration files, the section name can be the name of the cluster, and key names can be control names.

    I know OpenG has some pretty nice to do, but I prefer to use the native functions OR when I can.  When porting to a new system, there is no need to copy any additional screws library (OpenG library).  The native DV come with Labview.

  • How to remove line empty when the data are not for a text field

    I created a PDF with Acrobat Pro 11 model. This model has an address of the employer with the address line 1, address line 2, city, State, zip code, country. The requirement is to show address line 1 and line 2 address in separate lines and address line 2 cannot be present always. If address line 2 is not present then the PDF should not show a blank line. How do I get there?

    These data are populated through xml by a publisher of BI. New line characters do not work.

    Appreciate your help on this.

    Hi sprphoto123,

    If you do not enter data in the text field 2 then you can set the form field property to is not mandatory, but if you want to disable the 2nd text field, you can add a check box in front of it to turn off the field. This can be achieved using JavaScript.

    Kind regards

    Nicos

  • How to print line empty on the model of BEEP when the field has no value?

    I have a BEEP pattern like below and all these CHILDREN, NAME, GRAND_CHILDREN, are fields arranaged in the model as a line. REPS can enter the values in each of these areas for maximum 3 lines. The first 2 rows have values and the last is empty.

    CHILDREN: NAME: GRAND_CHILDREN: NAME:
    Son daughter of John Smith
    Daughter Laura son Kevin

    In the third row, because the fields have no value, the report print empty lines, but I want to remove this blank line and display only the rows (first 2 rows) that have values for the fields.

    Does anyone know how to get around this problem? Please help me solve this problem.

    Thanks in advance,
    RV

    Just having a condition in 3rd row, where DependentDD3 is printed.

    -3rd line 1st column
    last column - 3rd row

    This is true for nullity of DependentDD3. If you want to check for all columns and hide, use condition as

  • HDR-CX405 how to stop recording double, only the required mp4 files.

    Hello Sony,

    Yesterday I bought HDR-CX405. My question is, how to stop double registration? Only the required mp4 files.

    The two file created on the card then than shooing video scene - AVCHD and mp4.

    I don't want AVCHD (file too big), I want to just file mp4 only.

    Dual video REC

  • How to force line breaks in the RH9 glossary entries?

    Someone at - he found a way to do so that line breaks remain after generating the output? I understand that this is "ASCII text only" but even in a rudimentary text editor, I can force line breaks and insert characters extended like the bullets.

    Hello

    Because of the way this is implemented to WebHelp, it cannot be done. In AIR, don't know, but I suspect that it is the same for AIR.

    A better way would be to create glossary topics. Which removes restrictions on development in shape.

    Take a bow

    Willam

  • How long for secure erase of the 120 GB user account?

    14 hours ago, I started a secure erase of a 120 GB user account and he has not yet finished. Is this normal? I'm on os x on a macbook pro early 2011 mavericks.

    Yes. It could take days to complete the removal of the quantity of data using Secure Delete.

  • How to display Page also in the form of columns of report items?

    It seems that as soon as I do a column report a page element, and then disappears in the columns on the report. I want that page elements considered as well report columns. Is this possible in discoverer?

    Create a calculated item based on the item record. This effectively shows the column twice, once as part of page and then as a column.

  • line added to the custom report selector

    I made a report with some tables and I want to add the line with all the lines selector. Is that someone has an idea how to add line selector in the custom report


    Concerning

    Published by: Adi on January 20, 2010 23:21

    ADI
    Change the select list of the query of the report to add a "checkbox" as shown in the example below

    Select
    other_columns...
    apex_item.checkbox(1,'row_identifier') Row_selector
    table

    CITY

  • How to align an image centered in the advanced table column.

    Dear friends,

    I developed a page of the OAF with an image column in the advanced table, but by default the image column is not centered,
    How to make image centered in the advanced table column, please let me know your suggestions.


    Thank you
    Keerthi.K

    HAD,

    In your column, create a tabular presentation and a rowlayout and the image, and then put in the rowlayout. Set the horizontal alignment of the rowlayout inwards.

    Kristofer Cruz

Maybe you are looking for