How to display a set of results in a comma-delimited list?

I have a query that selects an attribute in a table:
Select the role of sport_roles

What is the best way to display the result set as a "comma-delimited list" and "display as text"?
for example, player, coach, referee

Thank you.

I think you mean comma-DELIMITED.

The easiest way is dependent on the version. And yours is?

In 11.1.0.6 and especially I prefer to use WM_CONCAT.
http://www.morganslibrary.org/reference/wm_functions.html

Tom Kyte, to asktom, provided a named function, STRAGG.

A version number will be essential in all cases.

Tags: Database

Similar Questions

  • How to display a set of data in a horizontal way

    Hi Experts,

    I need data horizontally in the table for example usually display group for each group display us data in following the way
    EMp No.
    1
    2
    3
    4
    5
    6
    7
    8
    BUT MY REQUIREMENTIS TO DISPLAY as

    NO. EMP: 1 2 3 4 5 6 7 8


    Please give some hint, thanks in advance.

    Thank you
    Pratap

    Can you send me the files?

  • How to display the result sqlplus in java?

    I want to call sqlplus to run some commands sql in java, but how can I print the result of sqlplus?

    In java code, I call sqlplus as:

    Process of p;
    Run the command
    p = Runtime.getRuntime () .exec (commandString);
    print the result of the command
    InputStream inputStream = p.getInputStream ();

    How to display the result of the execution?

    Published by: Yi on February 26, 2012 23:41

    You can use ProcessBuilder. Copy the following code starts sql * more and runs the script in the variable "filename". It displays the results in the console of NetBeans.

    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.File;
    import java.util.Map;
    
    public class test1 {
    
        public static void main (String args []) {
    
            test_script();
        }
    
        public static void test_script () {
    
            String fileName = "@test_table.sql";
            String sqlPath = "E:\\";
    
            String sqlCmd = "sqlplus";
    
            String arg1   = "user/password@sid"; -- plug in your user, password and db name
            String arg2   = fileName;
            try {
                String line;
                ProcessBuilder pb = new ProcessBuilder(sqlCmd, arg1, arg2);
                Map env = pb.environment();
                env.put("VAR1", arg1);
                env.put("VAR2", arg2);
                pb.directory(new File(sqlPath));
                pb.redirectErrorStream(true);
                Process p = pb.start();
              BufferedReader bri = new BufferedReader
                (new InputStreamReader(p.getInputStream()));
              BufferedReader bre = new BufferedReader
                (new InputStreamReader(p.getErrorStream()));
              while ((line = bri.readLine()) != null) {
                System.out.println(line);
              }
              bri.close();
              while ((line = bre.readLine()) != null) {
                System.out.println(line);
              }
              bre.close();
              System.out.println("Done.");
            }
            catch (Exception err) {
              err.printStackTrace();
            }
    
        }
    
    }
    

    Here is the content of the script at E:\\test_table.sql

    Prompt drop TABLE ANOTHER_TEST;
    DROP TABLE ANOTHER_TEST CASCADE CONSTRAINTS
    /
    
    Prompt Table ANOTHER_TEST;
    CREATE TABLE ANOTHER_TEST
    (
      BATCH_SEQ             NUMBER,
      BATCH_GROUP_ID        NUMBER,
      STATUS_FLAG           VARCHAR2(30 BYTE),
      OBJ_BEING_PROCESSED   VARCHAR2(80 BYTE),
      BATCH_RUN_START_DTTM  DATE,
      BATCH_RUN_END_DTTM    DATE,
      CREATE_DTTM           DATE,
      CREATE_USER           VARCHAR2(30 BYTE),
      UPDATE_DTTM           DATE,
      UPDATE_USER           VARCHAR2(30 BYTE)
    )
    LOGGING
    NOCOMPRESS
    NOCACHE
    PARALLEL ( DEGREE DEFAULT INSTANCES DEFAULT )
    MONITORING
    /
    
    COMMENT ON TABLE ANOTHER_TEST IS 'This is a test table.'
    /
    
    EXIT
    /
    
  • How to display the serial No. field not to mention that the search results displayed

    How to display the serial No. field not to mention that the search results displayed

    Hello

    You missed to add the varstatus property in your table

    Try with this code:


    lines = ' #{bindings. " SahajDetailVO1.rangeSize}.
    emptyText = "#{bindings." SahajDetailVO1.viewable? "{'No data to display.': 'Access Denied.'}".
    fetchSize = "#{bindings." SahajDetailVO1.rangeSize}.
    rowBandingInterval = "0" id = "t1" styleClass = "AFStretchWidth."
    varStatus = 'vs' >



  • How to display the results of a MySql query in multiple columns?

    Hi, I know how to display PHP/MySq

    l of the results in a single column, but I'm really stuck to show

    Ying the results of several columns in DW CS4.

    Can someone help me with a code example? I'm new to php/mysql. Thank you

    Are you asking how to rotate the query results? Do a search for a horizontal loop. If this isn't what you're asking, please provide more details.

  • How to display the results in the order based on the value of research

    Hi all

    How to display the results in the slot order.
     
    
    CREATE TABLE TEST( SONGID  NUMBER, TITLE   VARCHAR2(200))
    
    INSERT INTO TEST(SONGID,TITLE) VALUES (10,'AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (11,'CICCONE, MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (12,'DALLIN, MADONNA LOUISE/STOCK');
    INSERT INTO TEST(SONGID,TITLE) VALUES (13,'MADONNA');
    INSERT INTO TEST(SONGID,TITLE) VALUES (14,'MADONNA (A)/ AHMADZAI, MIRWAIS (C)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (15,'MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (16,'MIRWAIS AHMADZAI, MADONNA');     
    INSERT INTO TEST(SONGID,TITLE) VALUES (17,'MIRWAIS (CA)/ MADONNA (CA),AHMADZAI');
    INSERT INTO TEST(SONGID,TITLE) VALUES (18,'MADONNA (CA),CICCONE');
    
    SELECT *FROM  TEST WHERE INSTR (TITLE, 'MADONNA') > 0
    
    output: 
    SONGID     TITLE
    10     AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)
    11     CICCONE, MADONNA (CA)
    12     DALLIN, MADONNA LOUISE/STOCK
    13     MADONNA
    14     MADONNA (A)/ AHMADZAI, MIRWAIS (C)
    15     MADONNA (CA)
    16     MIRWAIS AHMADZAI, MADONNA
    17     MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
    18     MADONNA (CA),CICCONE
    
    Expected output :
    13     MADONNA
    14     MADONNA (A)/ AHMADZAI, MIRWAIS (C)
    15     MADONNA (CA)
    18     MADONNA (CA),CICCONE
    ..
    ..
    ..
    ..
    ...
    If the user makes a search with "MADONNA", I view the results as title begins with "MADONNA" first then the rest of the records.
    Please let me know is possible to show the results in this order.


    Kind regards
    Rajasekhar

    This can be a little more specific:

    SQL> SELECT *
      2  FROM   TEST
      3  WHERE  INSTR (TITLE, 'MADONNA') > 0
      4  ORDER  BY INSTR (TITLE, 'MADONNA')
      5           ,TITLE
      6  ;
    
                  SONGID TITLE
    -------------------- --------------------------------------
                      13 MADONNA
                      14 MADONNA (A)/ AHMADZAI, MIRWAIS (C)
                      15 MADONNA (CA)
                      18 MADONNA (CA),CICCONE
                      12 DALLIN, MADONNA LOUISE/STOCK
                      11 CICCONE, MADONNA (CA)
                      17 MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
                      16 MIRWAIS AHMADZAI, MADONNA
                      10 AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)
    
  • How to display literals in the SELECT because of a condition results column?

    Lets start with the simplified below table and table of values:

    TestTab:
    col1, col2
    ==== ======
    1, 2
    55.66

    Now I want to run a SELECT similar to:

    SELECT col1, ((col2 > 10)? ('Yes': 'no') «10 more»
    FROM testtab;

    should give the following result table:

    col1, 'one more big 10.
    ====== ========
    1, 'no '.
    55, 'yes '.


    Unfortuantely the replacement check inline (which exist in languages such as java, C++, and many others)

    ((col2 > 10)? ('Yes': 'no')

    which means:

    (condition)? exit-if-true: exit-if-false

    does not work in SQL.

    If not, how can I get such a result table?

    Peter

    Published by: user559463 on February 24, 2010 12:52 AM

    Do you need it?

    WITH TESTTAB AS
    (
    SELECT 1 col1, 2 col2 FROM DUAL UNION ALL
    SELECT 55,66 FROM DUAL
    )
    SELECT
        COL1,
        COL2,
        CASE
          WHEN COL2>10 THEN
            'YES'
          ELSE
            'NO'
        END "greater 10"
    FROM TESTTAB;
    
  • How to display e-mails from multiple accounts in windows mail?

    I created a second e-mail account in windows mail (WLM, NOT) but I can't figure out how to display messages sent to this account.  I asked my sister to send a test message to this special address and when I hit send/receive I don't receive it.

    Hi Jason,

    Please ensure that you have followed all the steps listed in this thread for your second e-mail account. It seems that the messages do not come through your Inbox, which leads me to believe one or more of the following are has been forgotten. http://Windows.Microsoft.com/en-us/Windows-Vista/Windows-mail-setting-up-an-account-from-start-to-finish

    I hope this helps and please post back with the results.

  • How to display date / time in the browser console?

    How to display date / time in the browser console?

    You can set through the Options (gear icon) page in the Web Console (Firefox/tools > Web Developer).
    This applies to the browser console and the Web console.

  • How to display the width of the page or the big screen in firefox 11 automatically?

    How to display the width of the page or the big screen in firefox 11 automatically? I know how to Ctrl +, ctrl - and ctrl 0, but is there a way to define 11 firefox to automatically set the page viewing by default "page width" or full screen (F11 not)?
    Help, please. Thank you.

    You can use an extension to set a page zoom and the size of the default font on the web pages.

  • How to display 4 charts on the same graphic screen when executing the VI 4 times?

    My goal is trying to show 4 different graphs on the same XY graph when I run the VI 4 times. Right now, the new graph will be to saturate the previous graph when I re - run the VI.

    Help, please!

    You need a mechanism to store the previous data; LabVIEW graphics have no history, they display data sets.  A shift register is an obvious answer, but it can be a little 'tricky' when the XY graph build is used because it accepts a DDT and you can not simply add a data set using table functions...

    The solution?

    Rather than make the changes for you, I created a simple example for a regular graph to show you how to use an uninitialized shift register to store values of previous test cycles (data will be lost when the VI is closed) while the VI is in memory.

    I'll let the conversion of the DDT in the 2D-table and graphical execution XY for you to understand where it is a form any duty.

    Good luck!

    -Bob

  • How to call the setting menu of the BIOS on HP DV4 1540us netbook?

    Hi all

    How to call the setting menu of the BIOS on HP DV4 1540us netbook?

    F2 does NOT an on-screen BIOS setting.

    Is there another trick?  Or, perhaps, defining the procedure step by step to start the BIOS?

    TIA

    Power on the laptop and all logo HP being displayed, press F10.

  • I downloaded a movie on Torrent & don't know how to display

    I downloaded a movie on my system & don't know how to display

    I downloaded a movie on my system & don't know how to display

    ===================================
    A Google search for torrent of view may be worth a try.

    Here is an example of the results:

    How to display ahttp://www.liutilities.com/how-to/view-a-torrent/ Torrent
    John Inzer - MS - MVP - Digital Media Experience - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.

  • How to display the speaker icon in the taskbar in windows 7?

    How to display the "speaker" of the taskbar icon in windows 7?

    Thank you

    concerning

    Jamal

    Hi Jamal

    1. right click on the taskbar, and then select Properties.

    In the Notification area section, click the Customize button.

    2. in the Configuration window, find the Volume icon.

    The Drop Down Menu to select the icon lounge and Notifications.

    3. If you don't see the Volume icon, click system icons activate or deactivate the link at the bottom of the window.

    Find the Volume icon and select enabled in the menu dropdown.

    Repeat step 2.

    Let us know the results.

    Concerning

  • How to display the thumbnails in the default view

    How to display the thumbnails in the default view. I have just started a test of DC Acrobat and cannot find how to set the thumbnail view as default.

    Thanks George. Seems to only work for individual documents. If I do your instructions, close the document and then re - open, then of course the miniature view opens immediately. However, if I open another document the thumbnail view is not here. I need the thumbnail view to be opened by default for all documents as older versions of Adobe and other PDF software. If you can help that would be great.

Maybe you are looking for