help in the application

Hi all

I'm on 11g

I have 2 rows of data as shown below n

fees code2 SIDS code1

Rank 15null123-546 S001
Rank 210456 72S001 null

and I want the result like this

fresh Code1 code sid 2

15 456-72 123 - 546 S001

The main thing that is a problem is the value of column code1 and code2.

When the group how to get them?

Any help?

Example:

SQL > ed
A written file afiedt.buf

1 with t as (select 5 in respect of fees, null as code1, 123-546' as code2, 'S001' as the SIDS of all the double union)
2. Select 10, 456-72', null, 'S001' from dual
3            )
4. Select sum (fairy) in respect of fees
5, max (code1) as code 1
6, max (code2) as code2
7, sid
8 t
9 * group by sid
SQL > /.

FEES CODE2 SIDS CODE1
---------- ------ ------- ----
15 456-72 123 - 546 S001

Tags: Database

Similar Questions

  • im a student at the Academy of art and my creative cloud only let's tracks me because I never offer or give a serial number need help with the application

    I need help for the account and the sotfware please help

    I'll get an update this topic & you update tomorrow.

    Concerning

    Baudier

  • help in the application without using the pivot function

    Hi gurus,

    Can you please help write the query without using the PIVOT function.
     WITH indata AS
             (SELECT 1 sn, '123:456,789,323:456,213,344,345:5454' x
                from dual
              UNION ALL
              SELECT 2, 'abcd:fgrfr,rfrf,rfred,tg:tg,tg:ophhh,op,vdfgbh:poijn' x from dual),
            instr AS
             (SELECT a.SN,
                     rownum RN,
                     B.column_value || CASE
                       WHEN B.column_value NOT LIKE '%:%' THEN
                        ':'
                     END column_value 
                FROM indata a,
                     TABLE(CAST(multiset
                                (SELECT trim(SUBSTR(x,
                                                    (CASE LEVEL
                                                      WHEN 1 THEN
                                                       1
                                                      ELSE
                                                       instr(x, ',', 1, LEVEL - 1) + 1
                                                    END),
                                                    (CASE instr(x, ',', 1, LEVEL)
                                                      WHEN 0 then
                                                       4000
                                                      ELSE
                                                       instr(x, ',', 1, LEVEL) - 1 -
                                                       (CASE LEVEL
                                                          WHEN 1 THEN
                                                           0
                                                          ELSE
                                                           instr(x,
                                                                 ',',
                                                                 1,
                                                                 level - 1)
                                                        END)
                                                    END)))
                                   FROM dual
                                 CONNECT BY level <=
                                            LENGTH(x) -
                                            LENGTH(REPLACE(x, ',', '')) + 1) AS
                                sys.odcivarchar2list)) b)
            SELECT  col1_val2,
                    col1_val1,
                    col2_val2,
                    col2_val1,              
                   systimestamp
              FROM (select SN,
                          ROW_NUMBER() over(partition by SN order by RN) RN,
                           SUBSTR(column_value, INSTR(column_value, ':') + 1) VAL1,
                           substr(column_value, 1, instr(column_value, ':') - 1) val2
                      FROM instr ) PIVOT(MAX(VAL1) VAL1, MAX(VAL2) VAL2 FOR SN IN(1 as col1,2 as col2));
    Thanks in advance!...

    Any help would be appreciated.

    user590978 wrote:

    Can you please help write the query without using the PIVOT function.

    with indata as (
                    select 1 sn,'123:456,789,323:456,213,344,345:5454' x from dual union all
                    select 2, 'abcd:fgrfr,rfrf,rfred,tg:tg,tg:ophhh,op,vdfgbh:poijn' x from dual
                   ),
             t1 as (
                    select  x
                      from  indata
                      where sn = 1
                   ),
             t2 as (
                    select  x
                      from  indata
                      where sn = 2
                   ),
             t3 as (
                    select  level lvl,
                            substr(
                                   x,
                                   instr(',' || x,',',1,level),
                                   instr(x || ',',',',1,level) - instr(',' || x,',',1,level)
                                  ) col1
                      from  t1
                      connect by level <= length(x) - length(translate(x,'A,','A')) + 1
                   ),
             t4 as (
                    select  level lvl,
                            substr(
                                   x,
                                   instr(',' || x,',',1,level),
                                   instr(x || ',',',',1,level) - instr(',' || x,',',1,level)
                                  ) col2
                      from  t2
                      connect by level <= length(x) - length(translate(x,'A,','A')) + 1
                   ),
             t5 as (
                    select  lvl,
                            substr(col1,1,instr(col1 || ':',':') - 1) col1_val1,
                            substr(col1,instr(col1 || ':',':') + 1) col1_val2
                      from  t3
                   ),
             t6 as (
                    select  lvl,
                            substr(col2,1,instr(col2 || ':',':') - 1) col2_val1,
                            substr(col2,instr(col2 || ':',':') + 1) col2_val2
                      from  t4
                   )
    select  col1_val1,
            col1_val2,
            col2_val1,
            col2_val2,
            systimestamp
      from      t5
            full join
                t6
            on (
                t6.lvl = t5.lvl
               )
      order by coalesce(t5.lvl,t6.lvl)
    /
    
    COL1_VAL1  COL1_VAL2  COL2_VAL1  COL2_VAL2  SYSTIMESTAMP
    ---------- ---------- ---------- ---------- -------------------------------------
    123        456        abcd       fgrfr      23-OCT-12 11.50.12.015000 AM -04:00
    789                   rfrf                  23-OCT-12 11.50.12.015000 AM -04:00
    323        456        rfred                 23-OCT-12 11.50.12.015000 AM -04:00
    213                   tg         tg         23-OCT-12 11.50.12.015000 AM -04:00
    344                   tg         ophhh      23-OCT-12 11.50.12.015000 AM -04:00
    345        5454       op                    23-OCT-12 11.50.12.015000 AM -04:00
                          vdfgbh     poijn      23-OCT-12 11.50.12.015000 AM -04:00
    
    7 rows selected.
    
    SQL> 
    

    SY.

  • Help with the application process

    I create a process like that, and it doesn't work. Can someone help me check what is the problem?

    declare
    number of l_counter;
    Start
    owa_util.mime_header ("text/xml", FALSE ");
    HTP.p ('Cache-Control: non-cache');
    HTP.p ('Pragma: non-cache');
    owa_util.http_header_close;
    HTP. PRN (' < select > < option value = "" >--select 2 results - </option > ');
    for rec in select (separate OUT2
    output
    where OUT1 =: V_OUT1 and OUT2 is not null
    order by the OID);
    l_counter: = 0;
    loop
    If REC OUT2 = "other - specify" then
    l_counter: = 1;
    on the other
    HTP. PRN ("< option value ="' | rec. OUT2 |) '">' || recomm. OUT2. ("< / option >");
    end if;
    end loop;
    If l_counter = 1 then
    HTP. PRN ('< option value = "other - specify" >' |) "Other - specify ' | ' < / option >");
    end if;
    HTP. PRN ("</select > '");
    end;

    Thank you
    Jen

    Published by: Jen Hu on July 12, 2012 11:29

    You had a semicolon after the beginning of the LOOP. You don't need this l_counter: = 0. Here is the code again.

    DECLARE
       l_counter   NUMBER := 0;
    BEGIN
       OWA_UTIL.mime_header ('text/xml', FALSE);
       HTP.p ('Cache-Control: no-cache');
       HTP.p ('Pragma: no-cache');
       OWA_UTIL.http_header_close;
       HTP.prn ('');
    END;
    

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Apress.com/9781430235125
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    http://www.Amazon.de/Oracle-Apex-XE-Praxis/DP/3826655494
    -------------------------------------------------------------------

  • With the help of THE application of the Clause

    Hi, I use a FROM clause query to display the records from a temporary table. I have this query below and works very well:

    {
    MYQUERY: = ' (SELECT DISTINCT SUBSTR (R.CIRCUIT_CODE, 1, 5) CIRCUIT_CODE, MAX (R.CONNECTED_LOAD) CONNECTED_LOAD, R.SUBSTATION_CODE, R.CLASSIFICATION
    SPM_CIRCUITS r
    WHERE substr (r.SUBSTATION_CODE, 6, 4) = "|" ' || : SPM_CIRCUITS. V_SCODE | " ' ||'
    AND DATE_COMMISSION < = TO_DATE (TO_CHAR (TO_DATE ('|))) '''|| : SPM_CIRCUITS. DATE_TO | " (((' |', "DD-MON-RRRR"), "DD-MON-RRRR"), "DD-MON-RRRR")
    AND (DATE_DECOMMISSION > TO_DATE (TO_CHAR (TO_DATE ('|)))) '''|| : SPM_CIRCUITS. DATE_FROM | " (((' |', "DD-MON-RRRR"), "DD-MON-RRRR"), "DD-MON-RRRR")
    OR R.DATE_DECOMMISSION IS NULL)
    GROUP OF SUBSTR (R.CIRCUIT_CODE, 1, 5), R.SUBSTATION_CODE, R.CLASSIFICATION
    ORDER BY CIRCUIT_CODE)';
    }

    However, recently I had to modify the query to use the the with... As command, which makes my query looks like this:

    {
    ' (WITH months LIKE)
    SELECT ADD_MONTHS ('|) '''|| : SPM_CIRCUITS. DATE_FROM | " (' |', LEVEL-1) m_first
    , (ADD_MONTHS ('|)) '''|| : SPM_CIRCUITS. DATE_FROM | " ((' |', LEVEL 0)-1) m_last
    OF the double
    CONNECT BY LEVEL < MONTHS_BETWEEN ('|) '''|| : SPM_CIRCUITS. DATE_TO | " ' ||', ' ||'' ' || : SPM_CIRCUITS. DATE_FROM | " ' ||') + 1
    )
    load_per_month AS)
    SELECT conn_load, SUM (conn_load) max_conn_load, m_LASt, CIRCUIT_code, substation_code, classification
    Of
    (SELECT SUBSTR(R.CIRCUIT_CODE,1,5) CIRCUIT_CODE, MAX (R.CONNECTED_LOAD) CONN_LOAD, R.SUBSTATION_CODE, R.CLASSIFICATION, m_last
    SINCE SPM_CIRCUITS R CROSS JOIN
    WHERE substr (r.SUBSTATION_CODE, 6, 4) = "|" ' || : SPM_CIRCUITS. V_SCODE | " ' ||'
    AND DATE_COMMISSION < = M_LAST
    AND (DATE_DECOMMISSION > M_FIRST OR R.DATE_DECOMMISSION IS NULL)
    GROUP BY SUBSTR(R.CIRCUIT_CODE,1,5), R.SUBSTATION_CODE, R.CLASSIFICATION, m_last)
    Conn_load, m_last, CIRCUIT_code, substation_code, classification GROUP)
    SELECT NVL (SUM (NVL(conn_load,0)), 0) load, m_last, CIRCUIT_code, substation_code, classification
    OF load_per_month
    WHERE conn_load = max_conn_load
    GROUP OF m_last, CIRCUIT_code, substation_code, classification
    ORDER BY m_last)';
    }

    However, I encounter a FRM-40505 error: ORACLE error: unable to execute the query. But I do not see the error. Can anyone help me please with my problem. Thank you very much in advance.

    I fixed the problem by using a different alias:

    SELECT NVL (SUM (NVL(conn_load,0)), 0) load, m_last, CIRCUIT_code, substation_code, classification
    OF load_per_month
    WHERE conn_load = max_conn_load
    GROUP OF m_last, CIRCUIT_code, substation_code, classification
    ORDER BY m_last)

    I changed to this:
    SELECT NVL (SUM (NVL(conn_load,0)), 0), connected_load, m_last, CIRCUIT_code, substation_code, classification
    OF load_per_month
    WHERE conn_load = max_conn_load
    GROUP OF m_last, CIRCUIT_code, substation_code, classification
    ORDER BY m_last)

    Apparently, the alias was wrong, but I don't really know why there is a cause of error it's just an alias. But thanks for your help.

  • Help download the applications on the new computer

    I can't seem to download the apps on my new mac cloud creatives. I have them on my old mac but I though you could have them on 2 computers. The only option I have is to 'try '. Pls help...

    Refer to this:

    Connect you or activation errors

    Contact support directly for anything else.

    Mylenium

  • The Application or DLL C;\program~1\Google\Google~1\Google62~1.DLL is not a valid Windows image. Please check this against your installation diskette.

    Original title: Please help

    The Application or DLL C;\program~1\Google\Google~1\Google62~1.DLL is not a valid Windows image. Please check this against your installation diskette.   I get this message all the time that I can still use my computer, but it is very annoying, I'd be very grateful for the help!

    Scan your computer with Malwarebytes. Get rid of AVG and get the free version of Avast (free if you can afford it). Get rid of Iobit. It doesn't help. Get rid of the advanced system of care. It will do more harm than good.

  • Since a recent issue of app updates on my iPad a applications - Gummy Drop mini disappeared and there seems to be no update in my update of the applications list or I can delete. I tried a reset nothing helps. What can I do? Thank you very much. Steve.

    Since a recent issue of app updates on my iPad a applications - Gummy Drop mini disappeared and there seems to be no update in my update of the applications list or I can delete. I tried a reset nothing helps. What can I do? Thank you very much. Steve.

    Not quite sure what "disappeared" means. You can try to remove and re - download.

  • Trying to install flash player. get the application single instance message can only rub, but it happened 2/3 days. Help?

    I tried to install Flash Player, but get the message that can only run one instance of the application. Have tried various things but not just anywhere.

    If anyone can help? Thank you.

    This error appears after completing the download and launch the installation file? If so, you may have to restart Windows. Sometimes the installer of Windows accumulates a delay in changes and stops working correctly until you restart the computer and let to clear its queue.

  • The Firefox HELP tab keeps appearing whenever I open the application or a new window. Firefox 3.6.28, Mac OS 10.4.11

    The Firefox HELP tab keeps appearing whenever I open the application or a new window. Firefox 3.6.28, Mac OS 10.4.11

    Ah, apparently it's reading I wanted as long as home pages; When I reset my homepage it started working right.

    Thank you

  • I've recently updated my Apple ID (including the change of password). However, could not connect to iTunes to update the applications or make purchases. Any help?

    I've recently updated my Apple ID (including the change of password). However, could not connect to the iTunes Store to update the applications or make purchases. Any help?

    Have you tried a forced reboot? Hold down the home and Sleep/Wake buttons simultaneously for about 15-20 seconds , until the Apple logo appears. You won't lose anything.

    Then sign out of the iTunes Store and reconnect.

  • FaceTime will not open on my Macbook pro (el capitan).  Message: "FaceTime close unexpectedly.  Click Reopen to reopen the application. Click report to display more detailed information and send a report to Apple. "Please help me.

    FaceTime will not open on my Macbook pro (el capitan).  Message: "FaceTime close unexpectedly.  Click Reopen to reopen the application. Click report to display more detailed information and send a report to Apple. "Please help me.

    Please launch the Console application in one of the following ways:

    ☞ Enter the first letters of his name in a Spotlight search. Select from the results (it should be at the top).

    ☞ In the Finder, select go utilities ▹ of menu bar or press the combination of keys shift-command-U. The application is in the folder that opens.

    ☞ Open LaunchPad and start typing the name.

    Step 1

    For this step, the title of the Console window should be all Messages. If it isn't, select

    SYSTEM LOG QUERIES ▹ all Messages

    in the list of logs on the left. If you don't see this list, select

    List of newspapers seen ▹ display

    in the menu at the top of the screen bar.

    In the upper right corner of the Console window, there is a search box to filter. Enter the name of the application crashed or process. For example, if Safari has crashed, you would enter "Safari" (without the quotes).

    Each message in the journal begins with the date and time when it was entered. Select the messages since the time of the last fall, as appropriate. Copy to the Clipboard by pressing Control-C key combination. Paste into a reply to this message by pressing command + V.

    The journal contains a large amount of information, almost everything that is not relevant to solve a particular problem. When you post a journal excerpt, be selective. A few dozen lines are almost always more than enough.

    Please don't dump blindly thousands of lines in the journal in this discussion.

    Please do not post screenshots of log messages - text poster.

    Some private information, such as your name, may appear in the log. Anonymize before posting.

    Step 2

    In the Console window, clear the search box, and then select

    DIAGNOSIS AND diagnostic USE information reports ▹ user

    (not diagnose them and use Messages) in the list of logs on the left. There is a disclosure triangle to the left of the list item. If the triangle is pointing to the right, click it so that it points downwards. You will see a list of reports of incidents. The name of each report begins with the name of the process and ends with ".crash". Select the most recent report on the process in question. The content of the report is displayed at right. Allows you to copy and paste to validate all of the content, text, not a screenshot.

    I know that the report is long, perhaps several hundred lines. Please report all this anyway. If the report is only a few lines, make sure that you have disabled the search box.

    If you don't see any report, but you know, he had an accident, you have chosen diagnostic and using the list of Log Messages. INFORMATION on the USE of DIAGNOSTIC AND choose instead.

    In the interest of privacy, I suggest that, before posting, you change the UUID ' anonymous, ' a long string of letters, numbers and dashes in the header of the report, if it is present (it cannot be). "

    Please do not post other types of diagnostic report - they are very long and rarely useful.

    When you post the journal excerpt or the accident report, you might see an error message on the web page: "you have included content in your post that is not allowed", or "the message contains invalid characters." It's a bug in the forum software. Thanks for posting the text on Pastebin, then post here a link to the page you created.

    If you have an account on Pastebin, please do not select private in exposure menu to paste on the page, because no one else that you will be able to see it.

  • I download the ios9.2 but I can't download the application on the Apple App Store. Some people say to delete the old App Store, but cannot download the new App Store. Please help me. Thank you.

    I have download the iis 9.2 application, but I can't download the application on Apple App Store.Some people say need removes the old App Store and download the new AppStore.I can not download the new app store. Please help me. Thank you.

    Can't download what app? What happens when you try? The App Store is part of the operating system. You can not download separately.

  • Help solve the kind of invalid application

    I uses the app.kind property to determine whether the environment is the time of execution or not. (I have an attached to this case statement and if in the runtime environment rather than the development environment additional code is acted)

    However, I'm kind of app invalid,

    It doesn't seem to be much doecumentation on this subject, any help would be appreciated.

    Thank you

    Issue is resolved for now, kind of app invalid appears if the statement is generated if the application is run, but the code generating the enum ring is not.

  • Open the application help in the specified monitor

    Hi all

    I work in a project that requires multiple monitors, each showing a different VI. Each of these screws has a 'Help' button that will open the help file compiled from the location mentioned in the hard drive. Now, I would like to open this help in the specified monitor. Suppose that if the user clicks on 'Help' in the second monitor, I would want this window to open it in the second monitor. Any suggestion on how to achieve this?

    Thanks in advance,

    Luxama

    Thanks Shivam Awasthi and Germain. By help, I mean the help files compiled with extensions *.hlp or *. chm. I use 'online Help Control' VI under range of dialogue & User Interface to open the help file. But it is still open in the monitor by default/primary. I would like to open in the monitor specified programmatically. I should be able to open it in according to watch her the user tries to access them from.

    Now I have the solution since the last post in this thread. I used the 'restore the window' and 'Move the window' live in the attachment to move the application window to another monitor by specifying limits entry.

    Thanks again.

    Luxama

Maybe you are looking for