I wanted to display the multiple rows in one row but column should be diff

Hi
Could any body help me regarding this query how to write to get the multiple rows in one row.
eg.
i have one table tab1(eno number,ename varchar2,uid1 varchar2,uid2 varchar2,uid3 varchar4)
but when i am runing the query I am getting multiple record against one eno number because of uid1,uid2,uid3
suppose value of table is
eno ename uid1 uid2 uid3
1 a u1
1 a u2
1 a u3
when i am quering it is coming same as above but I want in one row
eno ename uid1 uid2 uid3
1 a u1 u2 u3
can any onle help me how to write the query for this requirement.
thanks
saif

which is hard coded in my code? Here another approach, but fail for c as there is no information for the value of a column: does 1 in u1 means col 1, etc.
/* Formatted on 2012/05/29 16:29 (Formatter Plus v4.8.8) */
WITH t AS
     (SELECT 1 col1, 'a' col2, 'u1' col3
        FROM DUAL
      UNION ALL
      SELECT 1 col1, 'a' col2, 'u2' col3
        FROM DUAL
      UNION ALL
      SELECT 1 col1, 'a' col2, 'u3' col3
        FROM DUAL
      UNION ALL
      SELECT 1 col1, 'b' col2, 'u1' col3
        FROM DUAL
      UNION ALL
      SELECT 1 col1, 'b' col2, 'u3' col3
        FROM DUAL
      UNION ALL
      SELECT 1 col1, 'b' col2, 'u2' col3
        FROM DUAL
      UNION ALL
      SELECT 1 col1, 'c' col2, 'u1' col3
        FROM DUAL
      UNION ALL
      SELECT 1 col1, 'c' col2, 'u3' col3
        FROM DUAL)
SELECT   xx.col1, xx.col2, MAX (DECODE (xx.rn, 1, col3)) AS uid1, MAX (DECODE (xx.rn, 2, col3)) AS uid2,
         MAX (DECODE (xx.rn, 3, col3)) AS uid3
    FROM (SELECT t.col1, t.col2, t.col3, ROW_NUMBER () OVER (PARTITION BY col1, col2 ORDER BY col3) rn
            FROM t) xx
GROUP BY col1, col2;output:
COL1     COL2     UID1     UID2     UID3
1     a     u1     u2     u3
1     b     u1     u2     u3
1     c     u1     u3
Edited by: ʃʃp on May 29, 2012 2:30 AM

Similar Messages

  • I get the error "Cannot open port" when I want to display the directory content of one FTP servers with LabVIEW's internet toolkit functions. What is the problem? I'm logged on on the server.

    Is anyone experimenting this kind of problems or has resolved it? Thanks. I use LabVIEW 6.1 with Windows 98.

    Squish,
    This forum is for CAN questions. I would strongly urge you to repost your question to the LabVIEW General category and this is a LabVIEW question.
    Also, does the FTP Browser shipping example that comes with the Internet Toolkit work? If it does, then I would suggest studying that example. If it does not, then I would suggest reposting your question and giving much more detail about which VI is giving you the error and a general overview of the program.
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • I want to setup the time capsule on one network but use it on another

    I want to back up all my music onto a time capsule, but take the time capsule to different location so that I may have my music there as well.
    Can I do this?

    You will almost certainly have to re-configure the Time Capsule to work on the "other" network, but the data on the hard drive will not be affected when you do this.

  • Scripts : want to display the text in one line

    Dear Friends,
    i want to dispaly the below text in one line,but its displaying in next line.
    ITEM   MATERIAL  DESCRIPTION ORDERQTY  UNIT PricePerUnit NETVALUE
    i am using the following code
    IL           <K>Item,,Material,,Description ,,  Order qty.  ,,Unit   ,,    Price per unit   ,, Net value </>
    Thanks & Regards
    Shaik

    Hello Hussain,
    Remove the TAB Spacing ',,'. Instead u give the Space.
    Reduce the length of fonts.
    These are the ways to display the text in a line.
    If useful reward points.
    Regards,
    Vasanth

  • Want to display the UDID

    Hi,
    This is my first post on Adobe DPS forum.
    On one page I want to print the UDID of my iPad. But this should be a variable as whenever I open my folio on another iPad it should show the UDID of that iPad. All in all, whenever I open my folio it should display the UDID of the iPad on which I'm opening the folio. Is it possible?
    Thanks in adavance and best regards.
    With regards,
    Anil Yadav

    i don't think you have access to this 'sensitive kind of information'.
    a Google search for "html UDID display" might get you the answer in seconds.
    —johannes
    (mobil gesendet)
    Am 07.10.2011 06:11 schrieb "Anil Yadav" <[email protected]>:
       Re: want to display the UDID  created by Anil Yadav<http://forums.adobe.com/people/Anil+Yadav>in
    Digital Publishing Suite - View the full discussion<http://forums.adobe.com/message/3959005#3959005>

  • I want to display the 3 different counts in one table

    Hi,
    I have three different counts , now I want to display the 3 counts in one table. Is it possible,
    For example :
    1. Select count(*) from table1 ;
    Ans : 10
    2. Select count(*) from table2;
    Ans : 20
    3. Select count(*) from table3;
    Ans : 30
    Now I want to display like this
    A 10
    B 20
    C 30
    Thanks

    Nihar,
    You can write a pl/sql block to achieve this
    CREATE TABLE new_table (table_name VARCHAR2 (30), COUNT     NUMBER);
    DECLARE
       CURSOR mcur
       IS
          SELECT   table_name
            FROM   user_tables
           WHERE   table_name IN ('A', 'B', 'C');
       v_sql   VARCHAR2 (100);
       v_count number;
    BEGIN
       FOR x IN mcur
       LOOP
          v_sql := 'select count(*) from ' || x.table_name;
          EXECUTE IMMEDIATE v_sql INTO   v_count;
          INSERT INTO new_table
            VALUES   (x.table_name, v_count);
       END LOOP;
       COMMIT;
    END;
    select * from new_table;Regards

  • I'm using qurey panel with table.i want to display the rows as default

    Hi
    I'm using jdeveloper 11.1.1.2.0 with ADF 11g.
    I'm using qurey panel with table , for first time when i run ,rows are not displayed as default .After i fire search button records / rows are displaying.Now i want to display the rows in table when i run for first time , mean i want to display rows by default.
    thanks in advance.

    Hi,
    if the queryPanel is based on a ViewCriteria in ADF BC then this autoExecute can be defined on the VC definition
    Frank

  • Dont want to show the divided line between two rows in a Grid.

    Hello Friends,
    I want a Grid in which I want multiple rows but i dont want to show the divided line between two rows.
    It is just like a grid on Territories form(Administrator->SetUp->General->Territories)
    Thanks.

    Mithun,
    The component you're talking about is not a grid, and that component is not exposed by the UI API so you cannot use it.
    Regards,
    Vítor Vieira

  • I have a key figure in my master data table i want to display the key figur

    Hi All,
    I have a key figure in my master data table i want to display the keyfigure in my report how can i display it can somebody help me in this scenario 
    Regards
    Kiran Kumar

    Hi Kiran,
    Assume that Material master data table material has price as an attribute. To get this price as key fig in query, get material number in rows and in columns create new formula with replacement path to get material price as key figure.
    Note: Without taking material number into rows, we can't get the price into columns.
    Hope this helps u..
    Cheers......
    Sk babu

  • How will i display the multiple select ids in the dashboard ?

    I have a form where there is a multiple select. When the form is submit, the ids for the multiple select is stored in the database as concatenate. For example, multiple select : 3,9,5,1.
    The ids of the multiple select is found in a table TABLE1 and the insertion is done in another table TABLE2.
    Now I have to display them in a dashboard.
    My question is how will i display the multiple select ids in the dashboard ?
    I have to do an innerjoin with TABLE1 to retrieve the names of the multiple select ids. I don't know how to do it because the column name for multiple select in TABLE2 is of type text and the column id in TABLE1 is of type int.
    Please help me solve this problem.
    Thanks in advance

    One general advice is, never store comma-delimited lists in the database. In fact, the reason is to avoid problems like the one you now face.
    The major suggestion here is to re-design your database. Make sure each selected item (for example 3, 9, 5 or 1) is stored in its own row.
    To solve the problem as it now stands, you could do something like
    <cfquery>
    select myItems
    from table2
    where id in (select id from table 1 where ...etc.)
    </cfquery>
    Then use ColdFusion's list functions to do what your dashboard requires you to do.

  • I want to display the narrative view as All Choices

    Hi Experts,
    If ‘All choices’ option is selected, I want to display the narrative view as All Choices.
    How do I achieve it?
    Waiting for your reply....
    Regards,
    Sathyan

    Hi Sathyan,
    Set a presentation variable for that prompt.
    and in request, go to the column formula,
    CASE WHEN '@{pv_var}' IS NULL THEN 'ALL CHOICES' ELSE col_name END
    Regards,
    Raghu

  • I want to display the number of Passed / failed tests in Testtand xml report , please help me

    Hi, I want to display the number of Passed / failed tests in Testtand xml report , please help me.
    My requirement is later i should be able to display these number of passed/failed test in report header too.
    Solved!
    Go to Solution.

    I have attached a sequence to give you an idea of how to get the Result count (I didn't check it's working ), I have used "SequenceFilePostResultListEntry" callback to calculate the Result Count,
    and the Result Count is passed to the "ModifyReportHeader" through File Globals,  where you can edit the XML file to show it in the Repot (follow the link in my previous post).
    Hope this helps
    AshwiN,
    Attachments:
    Get Result Count.seq ‏8 KB

  • I want to display the Employee details in table format without using iGrid

    Hi all,
    Can anybody help me that I want to display the Employee details return by transaction in table  format without using iGrid.

    Hi, view the link below.
    http://help.sap.com/saphelp_xmii115/helpdata/en/Advanced_Topics/Customizing_Output/Customizing_Output.htm
    Hope this help.
    Danilo Santos

  • I want to display the website which i have designed using jsp in telugu....

    Hi,
    I want to display the website which i have designed using jsp,mysql in telugu.I have searched a number of articles but couldn't get sufficient information.I read articles on internationalise jsp based websites but they were about converting in other languages rather than indic languages.
    Could anyone let me know the procedure to convert it into indic languages.What all are required.
    Thanks.

    (Please keep the subject line to a short descriptive sentence. Don't put your entire question there.)
    LabVIEW can communicate via serial port. If the microcontroller listens to serial data, there must be a certain command to light a LED connected to a certain port. All you need is to check the manual to find out what the serial data needs to be.
    LabVIEW Champion . Do more with less code and in less time .

  • Want to display the item in MDM2 but dont want the customer to order it

    Hi
    I want to display the item in the catalog but i want to block the material from being orderd. how do i do that?

    Hi,
    SRM-MDM Catalog has somthing like display mode. You can set it in UI customizing. If you want to block order for only some of items, please create custom filed like "display only=X" and check the value in the BADI BBP_CATALOG_TRANSFER.
    Regards,
    Masa

Maybe you are looking for

  • Looking for All on one with USB Flash Drive Print/Scan support

    I am looking for an All in One Print/scan/copy. It should support print from USB Flash drive and scan to the same. Thanks

  • Tethering Phone Recommendations - Please help!!!

    Hi all, This is my first post. I am in Afghanistan in an area that has Cell phone service that also provides GPRS internet. This is pretty much as good as it is going to get, but there are always possibilites that this internet system may be upgraded

  • JavaScript help for newb

    I have used JavaScript before, but not within Apex. I have several calculated fields that I need to be able to update after user input (I think the onChange() function will work just fine). I have browsed through over a dozen threads on using JavaScr

  • Reg. sapscript in spanish

    I am trying to print some sales orders using spanish version of sapscript. Are the material descriptions supposed to come in Spanish? I am not getting so unless I change the descriptions of materials in Material-Master to spanish. What should I do so

  • IPod Notes markup

    I'm having some problems creating an interactive menu for my enormous collection of audiobooks using the notes features. All of the audiobook files are .m4b. The problem I am having is linking to an audiobook album, it just goes to a blank now playin