Semi colon separated between the values

Hello

I have a table:

CREATE TABLE TEST_A

(

ATT1 VARCHAR2 (10),

ATT2 VARCHAR2 (10),

ATT3 VARCHAR2 (10),

ATT4 VARCHAR2 (10));


INSERT INTO TEST_A

VALUES (NULL, 'A', NULL, 'B');


INSERT INTO TEST_A

VALUES(,'D',,'E');


COMMIT;


I want that the output voltage: select * from test_a as:


A; B

D; E


I want a semicolon separated between the values. If the first column has no value, it must not start with a separator semicolon.


Thank you


SELECT a.*,

TRIM)

BOTH

';'

OF REGEXP_REPLACE)

Att1 | ';' ||

att2 | ';' ||

att3 | ';' ||

ATT4,

';+',

';'

)

) att_list

OF test_a one

/

ATT1 ATT2 ATT3 ATT4 ATT_LIST
---------- ---------- ---------- ---------- ----------
A                     B          A; B
D                     E          D; E
A                                A

SQL >

SY.

Tags: Database

Similar Questions

  • most unique separator between the key and the value.

    Hello

    I need to write some implementation of a key delimiter value, while demand will insert this value and the delimiter that is not defined in the db.

    After that, I need to retrieve the key and the value, the question that this delimiter is defined by a custom code and it might be something.

    My problem starts when the delimiter that defined by custom code will be part of the 'key' or\and 'value '. in this case, the index of the key and value of the analysis or split or any regex-based will give the wrong key and value.

    Please advice, what is your suggestion for m searching the Internet to find any piece of information that can help.

    Thanks in advance.

    These examples are not relevant if your use case is not the same thing as what this code is from.

    1. you now have the rules.

    2. you have Java class files that implement these rules for a defined set of data types and work delimiters

    3. you have the Java source code for these class files so you can see exactly how the rules are applied and how specific types of data, and the delimiters affect the process.

    It is up to YOU to determine if the existing code will do what you need and, if not, to change this code (or write your own) that implements the rules for your use case.

    You have all the information you need to do the work. Nobody on the forum, and certainly not me, is going to write your code for you. If you can't do the job when you have ALL the necessary information then you will need to hire a consultant to do.

    Any other help is possible.

  • Updated between the values

    Hello

    Could someone help me with a very trivial problem.

    I have after the update clause, but it gives the error ORA-01427. Seems that it is between the two problem. How should I change what he begins to work?

    Update sales_in

    the value of sale = (select a.sales in the sales_out one

    where a.sales_year_month between 201501 and 201505);

    Update sales_in I

    the value of sale = (select a.sales in the sales_out one

    where a.sales_year_month = i.sales_year_month

    )

    where i.sales_year_month between 201501 and 201505;

  • Spaces between the values in the output

    Hi all

    I have a doubt, this is the scenario in the report.

    Try to display the names of channel which is a special category in the bottom of the report. The names are identified by the DESCR field in the <? FIELD? > tag, starting with a. (ex: A-SONY).
    But there are some other channels to come between the two, as the commercial channels. Comes it like that.
    <? FIELD? >
    <? DESCR? > A-SONY <? / DESCR? >
    <? / FIELD? >
    <? FIELD? >
    <? DESCR? > B-SPORTS <? / DESCR? >
    <? / FIELD? >
    <? FIELD? >
    <? DESCR? > A-STAR <? / DESCR? >
    <? / FIELD? >

    Now, when we display these values, it displays properly, but leaving a space between them, because it has other values in the meantime.
    Can we avoid this space?, this creates some alignment problems.

    Thanks in advance,
    Imtiaz.

    You can do it like below, so that it picks up the values beginning with 'A' alone

  • Adjustment of separation between the notes

    How to adjust the spacing between Notes Pages 5.6?

    P.S. This question seems to be recurring much in this forum. In the past, it was thanks to a non-intuitive location of the setting in the settings of 'Document '. Recently, it's because he disappeared from there...

    The ability to separate the reference entries according to a value specified in Pages v5 has not disappeared.

  • Column of child binding between the values of the parent record

    I know it is not a declarative constraint to do, but I wonder what ideas have for the best model to use.

    I have a table parent ALPHA with columns ALPHA_ID, start_date and end_date.
    Then I have a BETA child table with columns BETA_ID, ALPHA_ID, and TRAN_DATE.

    I would like to limit this BETA. TRAN_DATE is located between ALPHA. Start_date and ALPHA. End_date I hesitate to use a trigger because BETA will be many inserts.

    I looked at the creation of an ALPHA_DATE table with the columns TRAN_DATE, ALPHA_ID, start_date and end_date, with the first three columns as foreign key the same columns in ALPHA, and a CHECK constraint that (TRAN_DATE between start_date and end_date), then leave BETA (ALPHA_ID, TRAN_DATE) be a foreign key for ALPHA_DATE (ALPHA_ID TRAN_DATE).

    Thank you
    Matt

    Personally I would generate just triggers for it. And see if the drop in performance may be taken.

    Of course, in Oracle14 (or more?) you can do:

    create assertion alpha_beta_date_constraint
    check(not exists
    (select 'tuple in this join'
     from alpha a
         ,beta b
     where a.alpha_id = b.alpha_id
        and not (b.tran_date between a.start_date and a.end_date)
    ))
    /
    

    You can also use the infamous thing materialized view.
    -Create a MV that's bassically by using the query above to search for the faulty lines.
    -Add a check on this MV constraint which is always false (for example, check (0 = 1)).
    -Do a refresh on the validation of MV type.

  • Separator between the left and right.

    The generated WebHelp has a separator (used to resize) which divides the left pane (TOC) in the right pane (main content). This separator has a border and therefore appears as a thick gray elevated line. I would like for the separator to a border and so it will appear as a thin gray line.

    The way to proceed is to specify frameborder = "0" in the < frame > tag to the right pane. However, if I change this in my start page (after generation), this frameborder = "0" is simply not applied do. Can someone tell me what I'm missing?

    Thank you
    K

    You get a free copy of the Skinny on skins of Rick Stone tutorial. It is essential for this kind of thing!

    Good luck
    Leon

  • difference between the values in the adjacent table.

    Hello

    I want to subtract from the adjacent elements in a table. I mean 1 element element-2e, 2-3, 3-4, 4-5 and so on... I HAV searchd for array index handling rem. but dint get... Help me. Thanks in advance

    Hi n,

    as easy as this:

  • Problem of correspondence between the values in a table

    I have a table of product

    Qty of level type ID Grp
    ABC 101 1 1 100
    101 80 1 2 ABC
    101 3 1 65 ABC
    ABC 101 1 2 45
    ABC 101 2 2 100
    101 3 2 10 ABC

    Here, I need to check if the level (id.grp), type = 2 present in type 1 and type 2 = quantity is greater than 40% of the quantity of type = 1

    Finally, we should get

    Qty of level type ID Grp
    ABC 101 1 2 45 (more than 40% of 100)
    ABC 101 2 2 100 (more than 40% of 80)

    Please help me

    Thanks in advance
    SELECT *
      FROM product p1
     WHERE p1.TYPE = 2
       AND p1.qty > (SELECT MIN (p2.qty * 40 / 100)
                       FROM product p2
                      WHERE p1.id = p2.id
                        AND p1.grp = p2.grp
                        AND p1.level_ = p2.level_
                        AND p2.TYPE = 1
                    )
    

    Kind regards
    Vijay

    Published by: Vijaya Sekhar Reddy P on November 18, 2009 18:03
    Changed MAX and MIN

  • Separation of the two edge!

    Hi all

    Maybe a newbie question, but I haven't found an exact answer so far.

    I have two signals.

    A slow which I want to use as a trigger of power and a quick where I want to count the edges.

    I want to measure the number of edges of the fast signal occurring between two rising edges of the slow trigger signal.

    I read the help of separation of two edges and examples and always found three signals.

    So my question.

    Is it possibel to use two separation of edge with only two signals and connect the a slow (trigger)

    both DOOR and to THE?

    Or maybe someone can tell me how do to best accomplish this measuring task.

    Many thanks for any help,

    Ralf

    Since a picture is worth thousand words, here, try something like this:

    Here's the idea:

    1 counter is set up for the period measurement with units on the ticks.  Normally this would record the number of edges of a base clock of internal time between consecutive edges of the pulse train whose period is measured.  Here we are substituting the normal behavior a little bit.

    2. Notes the DAQmx Channel property node.  Let's say the task of counting your pulse train faster * rather * count of a database internal time clock.

    3. in the time mode, the counter will be reset to 0 in each cycle of the signal period.  So you will get a buffer zone to tell you how many more fast pulse occurred between the values * each * consecutive pair of slower pulse.

    4. we will ignore element 0 of the array because its value will be quite random, representing the start time of the task until the edge 1st period.  It is very often not explicit.

    -Kevin P

  • Validate the value of the text field

    Hello.

    I found this code:

    the value of power reactive

    var a = this.getField ("Name1");

    var two = this.getField ("Name2");

    var 3 = this.getField ("Name3");

    This feature assembles two field values into one with "and" as a separator.

    function concatFields (field1, field2, fieldDest) {}

    make sure that all variables are present

    If (Field1 & & Field2 & & fieldDest) {}

    var fieldVals = new Array();

    If (field1.value! = "& & field1.value! = null) {}

    fieldVals.push (field1.value);

    }

    If (field2.value! = "& & field2.value! = null) {}

    fieldVals.push (field2.value);

    }

    fieldDestResult = fieldVals.join ('and');

    fill the fieldDest only if it is empty

    if(fieldDestResult.value!=''|| fieldDestResult.value!=null) {}

    fieldDest.value = fieldDestResult;

    //}

    }

    }

    concatFields (one, two, three);

    These values to combine text two fields into one (text field nr.3) and put 'and' between the values. It works OK. But what happens if the two values are equal? Then, I need that one value is fill in field Nr. 3. Then. If the field 'Name1' and 'Name2' values are different, the two are combined in "Name3",... If the values are equal, the only one of them will be send to "Name3" on the ground.

    How can I do?

    Thanks for the reply.

    There is no coma have been a period should be. Be the soul of the last four lines:

    var Text1 = this.getField("Name1").valueAsString;

    var Text2 = this.getField("Name2").valueAsString;

    if(Text1 == text2) Text2 = "";

    Fill-in = Event.Value (Text1, Text2, "", "and");

    Additional code can be added to remove the distinction uppercase / lowercase and trim leading or white end space.

  • Is there an easy way to filter a 2D table based on the values in two fields?

    Y at - it an easy way to filter a 2D table based on the values of one of the fields. In my attached VI the output array has the following format:

    Ident Frame Type bytes TimeStamp data

    10:57:07.621 3AD00016 POUVEZ 8 0000000000000000 data frame

    10:57:07.622 3AD00017 CAN data frame 8 000005E000000000

    10:57:07.624 3AD00018 POUVEZ 8 0000000003300000 data frame

    10:57:07.625 2DC00000 POUVEZ 8 0000000000000000 data frame

    10:57:07.626 3AD00019 POUVEZ 4 0000030000000000 data frame

    I would like to delete all lines that do not have an "Ident" between the values of 3AD00000 and 3AD0001E. So for the data above the fourth row would be removed. The only way I can see to do this is to form a 1 d table. Is there a better approach?

    Thank you.

    Hi chuck72352,

    After you've sorted your data, you can use the function InRange. Combined with a "search in 1 table D", you get the range you really want.

    Mike

  • the gap between the list of select items in af:selectOneRadio?

    Hi all

    My version of Jdeveloper is 11.1.1.7.0.

    I have an af:selectOneRadio and select the button elements are added to this radio. But if we have four values then there is no space between each value of the element vertically.

    How to provide the gap between the value of each item select vertically?

    How can I achieve this requirement?

    Please provide your valuable suggestions.

    Thank you.

    This is not a style class but a skin selector, you need to add in your own skin file. Instructions on how to create a skin file based on an existing one are in the article that I posted the link.

    Here's what I see

    Timo

  • Table expanding: calculation of the difference in the value of the previous row

    Hello

    I'm a complete newbie to LiveCycle Designer (ES2) and created under the document with a table in full expansion.

    Shared files - Acrobat.com

    My goal is to make the friendly form by adding a calculation in the field "Twist" that calculates the difference of the current line to the previous row.

    I have no idea about Java Script, I'm afraid and also do not know if this is possible at all, so it's probably a bad idea after all.

    The reason for setting up as a table expansion is so that the form can be used for all 32 instances form would be used for (they all need different number of rows in total).

    The calculation will start in row 2 (Checklist.Table1), take the value of the entry in row 2 torsion and calculate the difference in the value of the twist entry in row 1.

    Then, in row 3, it calculates the difference between the value of the twist in the row 3 tier 2, etc.

    So subtract the value of the field in then with the value line onlinen-1 or something in that sense.

    Is there anyone at all who could help me with that at all?

    I would be very grateful for any advice you could give me.

    Thank you very much!

    Mathilda

    Hi Matilda,.

    Try this code;

    if (Row1.index > 0 && !Row1.resolveNode("NumericField4[0]").isNull)
    
     var prevTwist = Table1.resolveNode("Row1[" + (Row1.index - 1) + "].NumericField4[0]").rawValue
    
     var result = Math.abs(3000 / (Row1.resolveNode("NumericField4[0]").rawValue - prevTwist));
    
     this.rawValue = result;
    
     this.rawValue = "";
    

    Concerning

    Bruce

  • Difficulty over the months in time Sun based on the value of as txt

    Hi all

    We have two text measures startmonth and endmonth, how can resolve us to the time dimension based on the values of these measures of text? Difficulty for example (Mar: dec)

    Thank you

    James

    Hi James

    I'm sorry, it looks like you may need to go on a training Essbase. As I said you can NOT SET on data which are entered.

    You must FIX on all period member using something like @RELATIVE(YearTotal,0), then in your writing sets the IF statement as well as the data is calculated only at the period, you are at (The FIX on all periods will cover all periods) lies between the values entered by the user (i.e. the start month and end month values).

    An example below is to say in the depreciation calculation.

    "SYS_MONTH" is a member who places the VALUES against each Member period so that you can compare and match against the input values IE like VLOOKUP in Excel, then Jan = 1, Feb = 2... ***

    DIFFICULTY (FY13, @RELATIVE("Product",0), @RELATIVE("YearTotal",0)) I do not know you other dimensions you are trying to calculate against so you should add them

    "Depreciation")

    IF ("Start_Month"-> "Input_period"-> "Input_Year"-> "Input_product" "Input_period"-> "Input_Year" <= "sys_month"="" and="" "end_month"-="">-> "Input_product" > = "SYS_MONTH")

    "Depreciation" = xxxxxxxxxx Code to calculate depreciation;

    ON THE OTHER

    "Depreciation" = #missing;

    ENDIF)

    ENDFIX

    Imaging you are in a worksheet with Jan, Feb, Mar in the upper part and in the left column, you have the beginning and the end of the month entries. Calculation will increase from left to right and IF his calculation period that is to say that the SYS_MONTH member is between the beginning and the end of the month (4 and 11 below) then the depreciation is calculated, if it is then #missing, or you can choose not not to calculate.

    Input_Period Jan Feb Mar Apr May Jun Jul Aug Ms Oct Nov Dec
    SYS_MONTH #missing 1 2 3 4 5 6 7 8 9 10 11 12
    Start_Month 4
    End_Month 11
    Depreciation #missing #missing #missing #missing x x x x x x x x #missing

Maybe you are looking for

  • synchronized

    sync my ipod touch & lost half of my work (covers). don't have the CD. they are posted on itunes but not on my ipod touch more. synchronized again still the same

  • Help on Qosmio F10 atenna adapter

    Hello there I just got my phone today and the adpotor of the antenna that is supposed to go in the back of my lapto does not fit in there but the other end fits into the antenna cable and the other does not fit into my laptop because it's too big and

  • Satellite A50 - goes out of himself during the race

    my laptop turns off itself during its operation and am working on it. I already checked the connection ca; even the battery is ok. Can it be a problem of the cooling module? The fan runs all the time and the laptop gets very hot.There are solutions t

  • Qosmio F50 - 12W - processor Quad HD not recognized by the operating system

    Hello I can't find my Quad Core processor in my device manager. It is not in the sound, video processors... devices were it suppose to be. (or as an unknown device). As it is disconnected or something. Is it a hardware error or there is a special way

  • The Motorola bootloader, unlock site is broken

    Several people have commented on various forums that Moto X phones that should be allowed to have the unlocked bootloader are not able to at the moment. This includes me with a Moto X of Rogers. Motorola - please fix the bootloader unlock Web site!