Select the format of query results

SELECT * FROM srm_application_data WHERE application_id = '242564';

Returns

app_id question_name data
------ ------------- -----
242564 FirstName qreq
242564 StaffID 12314
242564 of State VIC
242564 o ' Connel of suburbs

I want that data to be presented as

First name 242564 qreg staffId 12314 State VIC Subrub o ' Connel

the path q & d:

 select id
      , wm_concat (name||' '||data)
   from test
  group by id
 ;

as in

SQL> with test as
  2  (
  3  select 242564 id, 'FirstName' name, 'qreq' data from dual union all
  4  select 242564 id, 'StaffID', '12314'            from dual union all
  5  select 242564 id, 'State', 'VIC'                from dual union all
  6  select 242564 id, 'Suburb', 'o''connel'         from dual
  7   )
  8   select id
  9        , wm_concat (name||' '||data)
 10     from test
 11    group by id
 12   ;

        ID
----------
WM_CONCAT(NAME||''||DATA)
------------------------------------------------------------------------
    242564
FirstName qreq,StaffID 12314,State VIC,Suburb o'connel

Tags: Database

Similar Questions

  • What happens if I select the format C:\ of Windows?

    I have Windows XP sp3 installed on my local C drive.

    I recently installed windows 7 on my D drive.
    Can I format my C drive by selecting the format option to click with the right button on the local C drive.
    If so, I have to reinstall my windows 7 again or can I directly start my windows 7.
    original title: Local C drive formatting

    You need to reinstall Windows 7 because the initialization information is stored on the boot drive which is C:\

    I would like to save your settings and personal files and make a new custom installation:
    http://www.notebooks.com/2009/10/13/WinXP-to-Win7/

    http://www.notebooks.com/2009/10/07/using-Windows-easy-transfer-in-Windows-7/

    The upgrade to Windows XP?

    Please read these instructions carefully and completely before you begin installing Windows 7: there are important steps that you must follow to upgrade your PC from Windows XP to Windows 7 in order to preserve your files and settings.

    Before you begin, you'll need to backup all your data to an external storage device, and you will need all the installation discs for the programs that you want to keep. Please make sure that you have an external hard drive (see details below).

    More detailed instructions are available at windows.microsoft.com/upgrade-windows-xp. Here are the basic steps.

    1. start Windows Upgrade Advisor (windows.microsoft.com/upgradeadvisor) to see if there are known issues that may affect the installation and the question of whether you should install the version of 32 or 64 bit Windows 7.

    2 back up your files and settings on an external hard drive using Windows Easy Transfer (windows.microsoft.com/windows-easy-transfer). If you do not have an external hard drive, you will not be able to use Windows Easy Transfer. Alternatively, you can copy the files you want to keep on a USB stick, CD or DVD.

    3. you will need to manually reinstall your programs, such as Microsoft Office, after I installed Windows 7. Gather the installation for your programs and all partner/license product key discs. You may be able to download programs from the Internet. For example, Windows Live Messenger can be installed from the download.live.com/messenger.

    4. Insert the Windows 7 DVD in your PC. When asked "which type of installation you want. Click on "Custom (advanced)."

    5. when Windows 7 is installed, use Windows Easy Transfer to restore your files and settings.

    If you are not comfortable Windows 7 installation, check with a local retail or the services of the PC company store to see if they offer upgrade services.

    Formatting the drive:
    Boot from the Windows 7 DVD
    Click Install now
    Accept the license agreement
    When the option is displayed to select a type of installation, click (Custom advanced)
    Click on drive Options
    Select the disc/s click on Delete
    Click new
    Click on apply
    Click OK
    Click Format, and then click next to proceed with the installation

  • Help on the game of query results

    Hi gurus,

    Have this survey for my requirement of dataset sql.

    Sample, it's that I have to pick up the nonfunctional currency transactions.

    Lets say for a given month, data that are present are for CurrencyA and CurrencyB for a particular account.

    Account1 has a transaction does not work CurrencyA and CurrenyB then Account2 has only transaction to CurrencyB.

    My current query result is that the 3 first lines, what I need is the 4th should also appear and be included.

    CurrencyA - amount - account1

    CurrencyB - amount - account1

    CurrencyB - amount - Account2

    CurrencyA - < '0' / or null >-Account2

    I think that my request is based on the currency < x > I have, so it should be for each account, he has all the lines for each currency.

    If please notify and let me know your thoughts.

    Kind regards

    Hello

    It looks like you want an outer join partitioned.

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the results desired from these data.
    Explain, using specific examples, how you get these results from these data.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002

  • Problems to use the cursor to select the format of pdf text precisely

    When you try to select a bit of text that is in a text (as opposed to a text box) on a form object, the cursor highlights several other items of text on the page.

    I'll try to reproduce it below:

    It is just the nature of the documents in pdf format, or is this something that can be avoided.

    I made sure to give each its own name text object, but the problem persists.

    Let's say that I tried to highlight all the end of this sentence.

    Note that the other texts are selected as well.  This would happen in a form when I would try to select only the text: "the end of this sentence."

    Its not impossible to select the text I want in acrobat, but it seems to be very sensitive on the forms. Just to have the cursor slightly outside the central axis of the text, and half of the shape is selected.

    Is it possible to make it more like the text in a text field?

    Thank you!

    Nope!

    It's just the way it is.

    Niall

  • Select the 1st successful query

    Hi guy,



    How to choose a first non-zero in the Group of sql query?


    for example


    Select a, b, c of

    (select a, b, c, x, where a = 'c')
    Select a, b, c of is where a = 'c '.
    Select a, b, c of z, where a = 'c '.
    )

    by 3 querys in a sub block, I select the first query executed successfully.

    Thank you.


    REDA

    Published by: infant_raj on May 20, 2009 03:53

    Published by: infant_raj on May 20, 2009 03:56

    Hello
    If the first query doesnot return a line, then the second query of the UNION will be executed.
    If the second query returns all data, and then those that will be shown, and similarly the third search also.

    You ran the query?

    The last sub query, change the names of the tables to x and y instead of y and z

    the names of the tables in the change request

    Published by: Anthony Alix on May 20, 2009 05:03

    Published by: Anthony Alix on May 20, 2009 05:08

  • limit the number of query results for content Presenter CMIS

    Hi dear,

    I have a problem. I added content present on my page in Jdev ide, not at run time. And I need a query including the limitation of the number of results.

    My query is: ${' SELECT * from ora: t:IDC:GlobalProfile WHERE the ora: p:xRegionDefinition =-"CSGMNEWS_REGDEF\" ORDER BY ora: p:dInDate DESC'}


    I just want to add a number parameter.

    Can you help me please? How can I limit the number of results?

    Kind regards

    Yacouba

    Published by: erdo on 21.Mar.2013 18:37

    Hello.

    Content Presenter has a setting (maxResults) to set the maximum returned results:

    Sample:

    xmlns = "http://xmlns.oracle.com/adf/controller/binding" Refresh 'ifNeeded' = >







    When you add your CP to a page at design time, you can access the pageDefinition and provide more values for attributes of CP.

    I hope this help you.

    Kind regards.

  • the case-insensitive query results

    I got a help from 11g with the suite of version information

    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE Production 11.1.0.7.0
    AMT for 32-bit Windows: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production

    The result of the query are case-sensitive

    Ex: Select * from Table_1 where column like '% new % ';

    result: News

    But do not go back NEWS News or news

    The result of the query are case-sensitive

    But you want the results to be case-insensitive?
    Well, then you can use:

    Select * from Table_1 where lower(column) like '%news%';
    

    And use a function based index.

  • How to speed up the time to query result

    When executing the following query, the result comes after 22 seconds.

    How I minimize this time? Please suggest.
    SELECT DISTINCT
           PERIOD_NO,
           ITEM_CODE,
           ITEM_NAME,
           SUM(CASE WHEN LEVEL_TYPE IN 'SUB ZONE' THEN WD_FORECAST_QTY_BU / CNV / ML ELSE 0 END)TOT_FRCST
    FROM   SHEET_HEAD, SHEET_DETAIL, ITEM_DETAIL
    WHERE  WH_SYS_ID = WD_WH_SYS_ID 
    AND    ITEM_CODE = WD_ITEM_CODE(+)
    AND    PERIOD_NO BETWEEN :PERIOD1 AND :PERIOD2
    AND    WH_REVISION_NO = 0 
    AND    WH_LEVEL_CODE NOT IN (SELECT WH_LEVEL_CODE FROM SHEET_HEAD WHERE WH_REVISION_NO = 1)
    GROUP BY   ITEM_CODE, ITEM_NAME, WH_PERIOD_NO
    Sanjay

    Hello

    with speed suggest it would be always be expirement with indexing on parameters, after that first scans all what is currently happening in what concerns analyses of full table etc. which are "more expensive."

    Level of the specific actions on your code, that what follows comes out too expensive; -

    AND    WH_LEVEL_CODE NOT IN (SELECT WH_LEVEL_CODE FROM SHEET_HEAD WHERE WH_REVISION_NO = 1)
    

    Here, I would see if you can rewrite, perhaps with a left join / auto join to achieve the same ends, compare the timings, you might be surprised.

    Kind regards

    Robert.

  • Help returns the array of query results

    Hi all... Pretty new to this so please forgive my ignorance. Running Oracle 11 g, trying to return results as in the example I give below. I don't know how the Sport field will have unique values, and I don't know how many unique values the year field is seen in the data. Does anyone have recommendations/suggestions?

    The structure of the table is:
    Year of sport
    Baseball 10-11
    Football 10-11
    Football 11-12
    Football 11-12
    Football 11-12
    Baseball 11-12

    The result should be sports in each year and should be grouped by year but shown as columns so:
    (GROUP OF the year)
    1, baseball 1, Football
    2, 1, Football Soccer 1, Baseball


    I hope that makes sense. Thanks for any help!
    ... Kaelon

    Does anyone have recommendations/suggestions?

    Maybe something like:

    SQL> with t as (
     select 'Baseball' sport, '10-11' year from dual union all
     select 'Football', '10-11' from dual union all
     select 'Football', '11-12' from dual union all
     select 'Football', '11-12' from dual union all
     select 'Soccer',   '11-12' from dual union all
     select 'Baseball', '11-12' from dual
    )
    --
    --
    select year, listagg(cnt || ', ' || sport, ' ') within group (order by cnt desc) sports from (
    select count(*) cnt, sport, year from t
    group by sport, year)
    group by year
    /
    YEAR    SPORTS
    ------- ----------------------------------------
    10-11   1, Baseball 1, Football
    11-12   2, Football 1, Baseball 1, Soccer       
    
    2 rows selected.
    

    ?

  • Number to reach the desired with query result...

    Here some pseudocode tables and data to show my problem:
    CREATE TABLE temp (name_home varchar2(25), name_away varchar2(25), id integer);
    INSERT INTO temp
    VALUES ('a','b',1,1);
    INSERT INTO temp
    VALUES ('c','a',1,3);
    INSERT INTO temp
    VALUES ('e','a',1,4);
    INSERT INTO temp
    VALUES ('c','a',1,6);
    INSERT INTO temp
    VALUES ('d','e',1,5);
    INSERT INTO temp
    VALUES ('b','a',1,7); 
    Desired output of table
            NAME_HOME     NAME_AWAY     ID     SEQ
    
    
         a            b             1     1
            b            a             1     7
         c            a             1     3
         c            a             1     6
         e            a             1     4
         d            e             1     5
    NOTE
    My table contains millions or lines like this, idea would be a solution that would be enough for a table containing millions of combos like those above.


    I want to display the data with the following by order:

    (1) records where any combination of a value of data in "name_home" and "name_away" appears more than one time first (record e.i. with seq 1.7)
    (2) sequence number CSA

    So, for seq 1 and 7, it does not matter to me that 'a' and 'b' switch between name_home and name_away, they must appear first because a combo of a and b in the same record appears more than once and the number of seq of one of the files is smaller than any of the seq in the accounts rendered by 'c' and 'a '. I hope that makes sense.

    Published by: user652714 on November 17, 2010 16:04

    Fixed, when I read until the end :)

    select
    t.*,
    count(*) over(partition by greatest(name_home,name_away),least(name_away,name_home)) cnt,
    first_value(seq) over(partition by greatest(name_home,name_away),least(name_away,name_home) order by seq) min_seq
    from temp t
    order by cnt desc,min_seq asc
    
    NAME_HOME     NAME_AWAY     ID     SEQ     CNT     MIN_SEQ
         a     b     1     1     2     1
         b     a     1     7     2     1
         c     a     1     3     2     3
         c     a     1     6     2     3
         e     a     1     4     1     4
         d     e     1     5     1     5
    

    Kind regards
    Sayan M.

    Published by: xtender on 18.11.2010 11:49

  • run immediately and the set of query results

    Hi gurus,

    I want to create a series of paintings on the fly using run immediately.
    the table_names are stored in another table work_table.


    run immediately (select 'create table' | table_name |) '(id int)' of
    * (select table_name in work_tables)); *


    This will raise error.

    ORA-06550: line 1, column 18:
    PLS-00103: encountered the symbol "SELECT" at the expected in the following way:

    (en) - + new case mod not null < an ID >
    < between double quote delimited identifiers of > < a variable binding >


    instead of using a cursor to run one by one is the lines an alternative solution?

    Thank you very much
    Charles

    May not know why you want to do it in a single statement, anyway:

    SQL> select * from work_tables;
    
    TABLE_NAME
    ------------------------------
    x1
    x2
    
    SQL> declare
      2  str varchar2(32000);
      3  begin
      4    for r in (select table_name from work_tables) loop
      5      str := str || 'execute immediate ''create table ' || r.table_name || '( id int )''; ' ;
      6    end loop;
      7
      8    execute immediate 'begin '||str||' end;';
      9
     10  end;
     11  /
    
    PL/SQL procedure successfully completed.
    
    SQL> desc x1
     Name                                                        Null?    Type
     ----------------------------------------------------------- -------- ------------------------------
     ID                                                                   NUMBER(38)
    
    SQL> desc x2
     Name                                                        Null?    Type
     ----------------------------------------------------------- -------- ------------------------------
     ID                                                                   NUMBER(38)
    

    Max
    http://oracleitalia.WordPress.com

    Published by: Massimo Ruocchio, February 18, 2010 15:03

  • Query results pane should display the entire XML following the execution of the query

    Hi, I'm trying to get the xml output results returned in sqldeveloper returned in full.

    they are truncated to.

    I tried the trick / * xml * / but that is implemented in the form xml cdata codes and other structures of nickname.

    Select xmlserialize (DOCUMENT

    XMLELEMENT ("root",

    XMLAttributes ('http://www.millicom.com' as 'xmlns'),

    XMLAGG)

    XMLELEMENT ("line",

    XMLFOREST (U.username,

    U.user_id,

    U.PASSWORD,

    U.ACCOUNT_STATUS,

    U.LOCK_DATE,

    U.EXPIRY_DATE,

    U.DEFAULT_TABLESPACE,

    U.TEMPORARY_TABLESPACE,

    U.CREATED,

    U.PROFILE,

    U.INITIAL_RSRC_CONSUMER_GROUP,

    U.EXTERNAL_NAME,

    U.PASSWORD_VERSIONS,

    U.EDITIONS_ENABLED,

    U.AUTHENTICATION_TYPE)))

    AS CLOB DASH)

    from dba_users U

    CROSS JOIN (select 1 of the double connect by level < = 10);

    Thanks for any help you can offer.


    JM

    Hi jm,

    In the line of query results, did scroll all the way to the right, then click twice on the «...» "at the end of the line to open the cell editor?

    So again, who does not show all the XML, it may be a problem with the version of the ojdb6.jar in use (11.2.0.3 client or later is required), or whether or not the JDBC OCI/thickness is used.  Read the following discussion: retrieve XMLTYPE based on very slow saved schema

    Kind regards

    Gary

    SQL development team

  • How to get the format YYYYMM, regardless of the month

    Hello, I want to be able to get the year months '201401' format and 201402 regardless of what month is only for the current year.

    Select to_char (Trunc (add_months (sysdate-2), 'MM'), "YYYYMM") of the double

    output:

    201409

    But if I move to the next month and use the same command, the output displays 201410.

    So basically how I would change the query to select the format of yearmonth from Jan Feb 2014

    Hello

    You can do this by truncating the sysdate for the current year:

    TO_CHAR (trunc (sysdate, 'YEAR'), "YYYYMM"); - 201401

    TO_CHAR (add_month (trunc (sysdate, 'YEAR'), 1), "YYYYMM"); - 201402

    This help you?

    Cheerz,

    Stako

  • Date format in the query result window Visual Studio

    Most of the seller tools allow you to change the date format to display datetime in its query results window.
    But .NET does not have this.
    The ability to change what should be in located in tools | Options, but this is not.
    Can it be added in the next version?
    ALTER SESSION SET NLS_DATE_FORMAT = 'HH DD-MON-RR' does not work. BTW.
    .NET or ODT too it rises.

    This might help:

    http://msdn.Microsoft.com/en-us/library/az4se3k1.aspx

    Ming Man

  • How to get SQL Developer 4.1 to display the query result?

    SQL DEV 4.0.3.16.84 execution of a SELECT statement is stored in a .sql file causes the window of the query result of pop-up indicating the result of a SELECT statement.  SQL DEV 4.1 is not to do so.

    Oops on my part; my SQL formatting has been the root cause.  I got used to insert split without any character of comment lines in front of them.  For example:

    ==================================================

    Select funny business;

    The foregoing indicates the behavior described.

    --==================================================

    Select funny business;

    With the dash double comment shows, the SQL works very well.

    This is different than previous versions of SQL Developer, but is probably better functionality.  I'll try to mark it as answered, but anyone with the admin should certainly do so if I can't.

Maybe you are looking for