A Multiple of a column value and display it as a line

I need to retrieve data from a particular column and display it as a row of data.

For example,.

Table

Col1 col2 col3
1-6-10
1-7-11
1-8-12
2-6-18
2 7 null
2-8-19

The data should be displayed using col 2 as partition as below

col1, col3 col3 col3
1 10 11 12
2 18 19 null

Help, please...

Hello

This is called a Pivot . The best wauy to do depends on your version of Oracle. The books following in Oracle 8.1 (or newer)

SELECT        col1
,        MIN (CASE WHEN col2 = 6 THEN col3 END)     AS col2_6_col3
,        MIN (CASE WHEN col2 = 7 THEN col3 END)     AS col2_7_col3
,        MIN (CASE WHEN col2 = 8 THEN col3 END)     AS col2_8_col3
FROM        t
GROUP BY   col1
;

but from Oracle 11, select the following... Function PIVOT is preferable:

SELECT     *
FROM     t
PIVOT     (     MIN (col3)
     FOR     col2 IN     ( 6     AS col2_6_col3
                    , 7     AS col2_7_col3
               , 8     AS col2_8_col3
               )
        )
;

To make a pivot, you should know, when you write the query, the number of columns will be in the output. If the number of columns depends on the data in the table at the time of the execution, then you neeed aggregation of chain , as in the previous answers, or dynamic SQL .

Published by: Frank Kulash, April 19, 2011 10:48
Accidentally, answered Pierre. Sorry; I wanted to respond to OP.

Tags: Database

Similar Questions

  • Replacing column values to display in the view layer

    1. I have a table of database containing the values of column as 'Q' (to quit), 'R' (for the race), the status of 'F' (for Failed). I want to show the values in the table on the user interface. Rather than show the values as Q/R/F, I need to show the Quit/Running/failure values in the user interface. I also need to update the column values based on action by the user in the user interface and later committed to DB.
    Can someone suggest me a way to achieve this "translation of value column in the user interface layer?
    2. a requirement more, that's that, I need to analyze the value of a column in a conditional manner and show the content derived in other columns in the same row (only in the user interface for the convenience of the user layer).
    Ex: Column A contains: abc >: < 123 >: < pqr >
    I need to analyze the value of this column and show < abc > in the column X, < 123 > in the column Y, < pqr > in the column out Z actually change the entries in the cache of the OS (since I need to validate any changes to DB later).

    Please suggest me the best approach to achieve the above two conditions.

    Yes...
    Add the function according to the jsp:root tag jstl library. Add jstl life library project controller

    xmlns:fn =http://java.sun.com/jsp/jstl/functions

    and proceed to
    http://download.Oracle.com/javaee/5/JSTL/1.1/docs/tlddocs/fn/split.fn.html

    Text = "#{fn:split('value',':')}.

  • divide a column value and insert it into several columns

    Hello
    am new to plsql.
    I want to divide a characters in a column and insert into multiple columns

    I tried the function substr used the symbol ',' vary its place dynamically, so I can't apply the substr function.


    for example: before split
    col1:
    col2:
    COL3:
    COL4:
    colu5: adsdf, fgrty, erfth, oiunth, okujt



    after separation

    col1: adsd
    col2: fgrty
    COL3: erfth
    COL4: oiunth
    col5: adsdf, fgrty, erfth, oiunth, okujt



    can someone help me

    Thank you

    Published by: 800324 on December 23, 2010 08:28

    Published by: 800324 on December 23, 2010 08:36

    What:

    SQL> create table t
      2  (col1 varchar2(30)
      3  ,col2 varchar2(30)
      4  ,col3 varchar2(30)
      5  ,col4 varchar2(30)
      6  ,col5 varchar2(30)
      7  );
    
    Table created.
    
    SQL> insert into t (col5) values ('adsdf,fgrty,erfth,oiunth,okujt');
    
    1 row created.
    
    SQL> insert into t (col5) values ('x,y');
    
    1 row created.
    
    SQL> insert into t (col5) values ('a,b,c,d');
    
    1 row created.
    
    SQL> select * from t;
    
    COL1                           COL2                           COL3                           COL4                           COL5
    ------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------------------------
                                                                                                                                adsdf,fgrty,erfth,oiunth,okujt
                                                                                                                                x,y
                                                                                                                                a,b,c,d
    
    3 rows selected.
    
    SQL>
    SQL> merge into t a
      2  using ( with t1 as ( select col5||',' col5
      3                       from   t
      4                     )
      5          select substr(col5, 1, instr(col5, ',', 1, 1)-1) col1
      6          ,      substr(col5, instr(col5, ',', 1, 1)+1, instr(col5, ',', 1, 2)- instr(col5, ',', 1, 1)-1) col2
      7          ,      substr(col5, instr(col5, ',', 1, 2)+1, instr(col5, ',', 1, 3)- instr(col5, ',', 1, 2)-1) col3
      8          ,      substr(col5, instr(col5, ',', 1, 3)+1, instr(col5, ',', 1, 4)- instr(col5, ',', 1, 3)-1) col4
      9          ,      rtrim(col5, ',') col5
     10          from   t1
     11        ) b
     12  on ( a.col5 = b.col5 )
     13  when matched then update set a.col1 = b.col1
     14                             , a.col2 = b.col2
     15                             , a.col3 = b.col3
     16                             , a.col4 = b.col4
     17  when not matched then insert (a.col1) values (null);
    
    3 rows merged.
    
    SQL> select * from t;
    
    COL1                           COL2                           COL3                           COL4                           COL5
    ------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------------------------
    adsdf                          fgrty                          erfth                          oiunth                         adsdf,fgrty,erfth,oiunth,okujt
    x                              y                                                                                            x,y
    a                              b                              c                              d                              a,b,c,d
    
    3 rows selected.
    
    SQL> 
    

    Assuming you're on 9i...

  • How to capture and display the end of line character in the report

    Hi guys,.

    I have a report that we are poster campaign ID, campaign name, and Description of the campaign.
    The result is coming like this

    Description of campaign campaign campaign ID name
    1 ABC 1 Plan June 13. 2 market July 1. 3. end July 30.
    Plan XYZ 2 1 13 June. 2 market July 1. 3. end July 30.

    But we want the data to be displayed in the following format.

    Description of campaign campaign campaign ID name
    1 ABC 1 Plan June 13.
    2 market July 1.
    3. end July 30.
    Plan XYZ 2 1 13 June.
    2 market July 1.
    3. end July 30.
    That the user has the possibility to enter several lines for the description in front end Application & want us to show the same way Description. How can I capture this end of the character in ETL? If he is already captured, then how to show in the report.
    I use Siebel as before end application and for the ETL using Informatica.

    Any help will be much appreciated.

    Thank you
    Rupesh

    OBIEE presentation Service is an HTML element based on software then it does not show the end file character CHR (10) or Chr (13).
    You must replace this with the HTML tag charcaters
    .

    I'm not sure of the name of the function, but you must make a formula like this

    replace(mytable.mycolumn, chr(10), '
    ')

    See you soon
    Nico

  • Compare the column values for multiple lines

    I am new to oracle and I have a requirement to compare the values of column across multiple lines.  If all column values are the same, I want to display that value, if the columns are not the same, I need to display 'no match' as value.   I need id to group values and display a status value based on the above logic.   Can anyone offer assistance with dispalying the result expected below?

    Sample

    Table

    State ID

    1         S

    2         L

    1         S

    2          S

    expected results

    State ID

    1         S

    2 no match


    Hello

    That's what you asked for:

    SELECT id

    CASE

    WHEN COUNT (DISTINCT status) > 1

    THEN "no match."

    For ANOTHER MIN (status)

    The END as status

    T

    GROUP BY id

    ;

    Want that if each State ID is NULL?  The CASE expression above returns NULL in this situation.

  • When the value to display in the time format double digital indicator... Changes in value.

    Hi all

    I can't display the values that I want. I have a value double say 320 sent to a digital indicator where I edited the properties of it to display in a time format that contains only minutes and seconds as Yes, 3:20 '. Unfortunately, it takes the value and change it to another value and display that. I don't know what is the issue. If anyone knows the solution... Please post!

    There is an image attatched!

    Thank you.

    I believe only then due to the fact that when I convert a timestamp value to double as 03:20, he gave me 320. So I thought that the reverse can be trying. Should I just enter the total amount of seconds and that will show the Minuteseconds I want?

    Thanks for the quick response.

  • How to add groups of radio buttons values and show the answers?

    I have eight groups of option buttons. The student must select the button from each group. It is a survey of personal intrestet. If each of the groups will have a button with related values. I need to add values and display the results.

    I have been looking for help, but can't find anything that explains how to add values of radio buttons and display the answers.

    That's what I got so far:

    The option button ActionScript 3.0 / / Avraham Saltoun / / solutions to say-web dot com / / FREE to USE, COPY and DISTRIBUTE

    Import fl.controls.RadioButton;
    Import fl.controls.RadioButtonGroup;
    These libraries must be imported
    in order to access the properties and methods of the Radio button.


    We will Appply formatting
    for the radial buttons
    var format: TextFormat = new TextFormat;
    format. Size = 16;
    format.font = "Trebuchet MS"
    format. Color = 0xFFFFFF;

    myNonconformist.label = "a maverick".
    myConcreteThinker.label = "a concrete thinker."
    myNaturalWithNumbers.label = 'a natural with numbers. "
    myAnalytical.label = "Analytics."
    myAssertive.label = "assertive".
    myIdealistic.label = "Idealistic."
    myCareful.label = 'Careful ';
    myProblemSolver.label = "a problem solver."
    myConscientious.label = 'consciousness '.
    myCreative.label = "Creative."
    myPrecise.label = "precise."
    myEfficient.label = "effective."
    myEnergetic.label = 'energetic ';
    myExpressive.label = 'Expressive ';
    myFriendly.label = 'Friendly ';
    myPersistent.label = 'Permanent '.
    myHelpful.label = "fairly useful";
    myInnovative.label = "innovative";
    myInquisitive.label = ' Inquisitive/Curious. "
    myAccurate.label = "precise."
    myEnthusiastic.label = "enthusiasts";
    myInsightful.label = "insightful";
    myIntuitive.label = 'intuitive ';
    myMechanicallyInclined.label = 'mechanically inclined. "
    myObservant.label = 'observer ';
    myOutgoing.label = "outgoing";
    myPatient.label = "Patient";
    myPersuasive.label = "persuasive."
    myRealistic.label = 'realistic ';
    myPractical.label = 'practice ';
    myScientific.label = 'scientific ';
    mySelfconfident.label = "safe";
    myImaginative.label = "imaginative."
    mySociable.label = "Sociable".
    myStraightforward.label = "direct."
    myUnderstanding.label = "understanding."

    Now, let's apply the style
    created for our labels
    myNonconformist.setStyle ("textFormat", format);
    myConcreteThinker.setStyle ("textFormat", format);
    myNaturalWithNumbers.setStyle ("textFormat", format);
    myAnalytical.setStyle ("textFormat", format);
    myAssertive.setStyle ("textFormat", format);
    myIdealistic.setStyle ("textFormat", format);
    myCareful.setStyle ("textFormat", format);
    myProblemSolver.setStyle ("textFormat", format);
    myConscientious.setStyle ("textFormat", format);
    myCreative.setStyle ("textFormat", format);
    myPrecise.setStyle ("textFormat", format);
    myEfficient.setStyle ("textFormat", format);
    myEnergetic.setStyle ("textFormat", format);
    myExpressive.setStyle ("textFormat", format);
    myFriendly.setStyle ("textFormat", format);
    myPersistent.setStyle ("textFormat", format);
    myHelpful.setStyle ("textFormat", format);
    myInnovative.setStyle ("textFormat", format);
    myInquisitive.setStyle ("textFormat", format);
    myAccurate.setStyle ("textFormat", format);
    myEnthusiastic.setStyle ("textFormat", format);
    myInsightful.setStyle ("textFormat", format);
    myIntuitive.setStyle ("textFormat", format);
    myMechanicallyInclined.setStyle ("textFormat", format);
    myObservant.setStyle ("textFormat", format);
    myOutgoing.setStyle ("textFormat", format);
    myPatient.setStyle ("textFormat", format);
    myPersuasive.setStyle ("textFormat", format);
    myRealistic.setStyle ("textFormat", format);
    myPractical.setStyle ("textFormat", format);
    myScientific.setStyle ("textFormat", format);
    mySelfconfident.setStyle ("textFormat", format);
    myImaginative.setStyle ("textFormat", format);
    mySelfconfident.setStyle ("textFormat", format);
    mySociable.setStyle ("textFormat", format);
    myStraightforward.setStyle ("textFormat", format);
    myUnderstanding.setStyle ("textFormat", format);

    Event listeners
    Define waiting for the compiler
    for a click
    myNonconformist.addEventListener (MouseEvent.CLICK, whoAmI);
    myConcreteThinker.addEventListener (MouseEvent.CLICK, whoAmI);
    myNaturalWithNumbers.addEventListener (MouseEvent.CLICK, whoAmI);
    myAnalytical.addEventListener (MouseEvent.CLICK, whoAmI);
    myAssertive.addEventListener (MouseEvent.CLICK, whoAmI);
    myIdealistic.addEventListener (MouseEvent.CLICK, whoAmI);
    myCareful.addEventListener (MouseEvent.CLICK, whoAmI);
    myProblemSolver.addEventListener (MouseEvent.CLICK, whoAmI);
    myConscientious.addEventListener (MouseEvent.CLICK, whoAmI);
    myCreative.addEventListener (MouseEvent.CLICK, whoAmI);
    myPrecise.addEventListener (MouseEvent.CLICK, whoAmI);
    myEfficient.addEventListener (MouseEvent.CLICK, whoAmI);
    myEnergetic.addEventListener (MouseEvent.CLICK, whoAmI);
    myExpressive.addEventListener (MouseEvent.CLICK, whoAmI);
    myFriendly.addEventListener (MouseEvent.CLICK, whoAmI);
    myPersistent.addEventListener (MouseEvent.CLICK, whoAmI);
    myHelpful.addEventListener (MouseEvent.CLICK, whoAmI);
    myInnovative.addEventListener (MouseEvent.CLICK, whoAmI);
    myInquisitive.addEventListener (MouseEvent.CLICK, whoAmI);
    myAccurate.addEventListener (MouseEvent.CLICK, whoAmI);
    myEnthusiastic.addEventListener (MouseEvent.CLICK, whoAmI);
    myInsightful.addEventListener (MouseEvent.CLICK, whoAmI);
    myIntuitive.addEventListener (MouseEvent.CLICK, whoAmI);
    myMechanicallyInclined.addEventListener (MouseEvent.CLICK, whoAmI);
    myObservant.addEventListener (MouseEvent.CLICK, whoAmI);
    myOutgoing.addEventListener (MouseEvent.CLICK, whoAmI);
    myPatient.addEventListener (MouseEvent.CLICK, whoAmI);
    myPersuasive.addEventListener (MouseEvent.CLICK, whoAmI);
    myRealistic.addEventListener (MouseEvent.CLICK, whoAmI);
    myPractical.addEventListener (MouseEvent.CLICK, whoAmI);
    myScientific.addEventListener (MouseEvent.CLICK, whoAmI);
    mySelfconfident.addEventListener (MouseEvent.CLICK, whoAmI);
    myImaginative.addEventListener (MouseEvent.CLICK, whoAmI);
    mySelfconfident.addEventListener (MouseEvent.CLICK, whoAmI);
    mySociable.addEventListener (MouseEvent.CLICK, whoAmI);
    myStraightforward.addEventListener (MouseEvent.CLICK, whoAmI);
    myUnderstanding.addEventListener (MouseEvent.CLICK, whoAmI);
    Note that all lead to the same function.

    It will probably be better for you to do it the hard way and assign labels, values and groups in the programming environment using the settings panel.

  • How to display more than 200 lines in the table?

    Hi Experts,

    Is it possible to display more than 200 rows in a Table.
    When I query table, it has 1000 rows, I want to display all 1000 rows in the table.

    When I have a query, the values are displayed up to 201 lines only,
    When I then click on 200 and 201 he throws Exception says
    * "The query exceeded 200 lines. Potentially more rows exist, please restrict your query. » *

    I would like to know how to display every 1000 lines in a table without Exception.

    Any idea will be highly appreciated.

    Thank you
    Pascaline

    The number of rows retrieved is controlled by the option to profile ' FND: view object Fetch Size Max. I think that 200 is the default value. PL see these Docs MOS

    386402.1 - query exceeded 200 lines
    275876.1 - oracle Application Framework profile Options version 11i (11.5.10)

    HTH
    Srini

  • AutoComplete - see value in the form of multi line + return value.

    Hi Experts,

    I had a simple solution for AutoComplete to see the multi line like: select line1 | Chr (10) | Line2 | Chr (10) | line 3 of une_table.
    In onblur DA it is a process that reduces the value, set the fields another request based on the process of pl/sql.

    After the upgrade to the latest version of apex + modified model - the integer value is displayed as a single line only (no need to any text is indicated).

    I want to manage something like: ExtJs - Ajax search field
    http://Apex.Oracle.com/pls/OTN/f?p=PLAYPEN:1:264121214928301:

    Is there a solution to the APEX to use AutoComplete with multi display value line without incorporating the ExtJs?
    Sorry for my English :)

    Thank you!
    Concerning
    J :D

    I'll add my plugin in 2 or 3 days...

    Welcome

  • Multiplies two values of two different columns and display in cold fusion!

    Hi all

    I have a table book_sale
    Topic | quantity | rate
    ===================
    Science | 5. $25.00
    Mathematics | 7. $70.00
    Reading | 20. $2.30
    ==========================================================
    I tried to code
    < cfquery name = "get_saleamount" datasource = "Book" >
    Select the object, the quantities, rates
    of book_sale
    < / cfquery >

    < table >
    < b >
    < /Th > < th > topic
    < /Th > < th > quantity
    < /Th > < th > rates
    Proceeds from the sale of < /th > < th >
    < /tr >
    < cfloop query = "get_saleamount."
    < b >
    < td > #Subject # < table >
    < td > #Quantity # < table >
    < td > #Rate # < table >
    < td > #Quantity # * #Rate # < table >
    < /tr >
    < / cfloop >
    < /table >

    The multiplication operation did not work code above. I want to calculate sale_amount = quantity * note and display the results in a table. Please give me some advice how to multiply two values from database and display them in a table above. Thanks in advance.




    If you want to exit, then simply change your
    #Quantity # * #Rate #.
    TO
    #Quantity * rate #.

    but you can do it at the level of the database, if you have db (most do so):

    Select the object, the quantities, rates, (amount * rate) AS ttl_cost
    of book_sale

    ...


    #Subject #.
    #Quantity #.
    #Rate #.
    #ttl_cost #.

    Azadi Saryev
    SABAI - Dee.com
    http://www.SABAI-Dee.com/

  • Display the name of the tag as the column name and the value in the tag as a row of data from the input string.

    Hi Forum members,

    I am looking for a query display the name of the tag as the column name and the value in the tag as a row of data.

    I have to print the values within the tag to a file by choosing the value of the flags. the sequence of the tags will vary each time, as the tag name will change dynamically.

    So here is the example of input data and the expected output. The string in the text column must be separated as the column names and values.

    Input data
    Select 1 as seqno,' < > 0210A 50 4f < / 4f > < 5f20 > TEST CARD 16 < / 5f20 > < 5f2a > < / 5f2a > < 82 > 1 c 00 < / 82 > ' double text


    Output:

    Seqno 4f 5f20 5f2a 82
    0210A 50 16 1 00 TEST CARD 1

    Please help me by providing your entries on this.

    We use the version of Oracle 11.2.

    Note: This is not the XML string

    Thank you

    Shree

    with

    data in the form of

    (select 1 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2a><82>00 1' text of all the double union)

    Select 2 as seqno,'XYZ<4F>0210 A 50<5f20>TEST CARD 16<5f2a><82>00 1' text of all the double union

    Select 3 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2A><82>1 00XYZ ' text of all the double union

    Select option 4 as seqno,'<4F>0210 A 50<5F20>TEST CARD 16<5f2A><82>1 00XYZ' double text

    )

    Select d.seqno, x.*

    d the data,

    XMLTable ('/ root')

    by the way xmltransform (xmltype ('': replace (replace (text,'<><>'),)))

    XmlType (q'~http://www.w3.org/1999/XSL/Transform "version ="1.0"> ")

                                                     

                                                       

                                                         

                                                       

                                                     

                                                     

                                                       

                                                         

                                                       

                                                     

    ~'

    )

    )

    path of columns '4f' varchar2 (10) "tag4f."

    path of "5f20' varchar2 (30)"tag5f20. "

    path of '5f2a' varchar2 (10) "tag5f2a."

    path of varchar2 (10) "82" "tag82.

    ) x


    SEQNO 4f 5f20 5f2a 82
    1 0210A 50 16 TEST CARD - 1 00
    2 0210A 50 16 TEST CARD - 1 00
    3 0210A 50 16 TEST CARD - 1 00
    4 0210A 50 16 TEST CARD - 1 00

    with

    data in the form of

    (select 1 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2a><82>00 1' text of all the double union)

    Select 2 as seqno,'XYZ<4F>0210 A 50<5f20>TEST CARD 16<5f2a><82>00 1' text of all the double union

    Select 3 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2A><82>1 00XYZ ' text of all the double union

    Select option 4 as seqno,'<4F>0210 A 50<5F20>TEST CARD 16<5f2A><82>1 00XYZ' double text

    ),

    Chopper (seqno, Key, value, String) as

    (select seqno,

    regexp_substr (text,'<(.+?)>', 1, 1, null, 1),

    regexp_substr (Text,'>(.*?))

    regexp_substr (text,'<.+?>. *? ) (.*) $', 1, 1, null, 1). » <>'

    from the data

    Union of all the

    Select seqno,

    regexp_substr (String,'<(.+?)>', 1, 1, null, 1),

    regexp_substr (String,'>(.*?))

    regexp_substr (String,'<.+?>. *? ) (.*) $', 1, 1, null, 1)

    Chopper

    where regexp_substr (string,'<(.*?)>', 1, 1, null, 1) is not null

    )

    Select '4f', seqno, '5f2a', '82', '5f20.

    of (seqno, lower (key) select key, value)

    Chopper

    )

    Pivot (max (value) for key in ('4f' as '4f', '5f20' as '5f20', '5f2a' as '5f2a', "82" as "82"))

    Concerning

    Etbin

  • Add multiple column values in another column

    Hello

    I have a table with structure below

    Date of the transaction Country Division of Entity Flag Total
    January 5, 2015GB11CRNews errors5
    January 5, 2015GB11PassNews errors5

    I need to display it in below format

    Date of the transaction Country Division of CR-news mistakes Spend-news mistakes Total-news mistakes
    January 5, 2015GB115510

    If you see the above format, I want the lines had to be transposed to the columns that depends on the value of the INDICATOR. A flag as 'New errors' entry will have a multiple entity (Cr, spend)

    On this basis, we must for the Date of the Transaction, country, Division of the Group and display the data.

    Sum of the total errors in a specific indicator should be displayed in a column.

    I tried under query to convert the columns.

    Select t.transaction_dt, t.cntry_id, t.div_id,

    NVL ()max()decode(t.entity | ) '-' : t.Flag, ' CR-news mistakes ' , t.TOTAL)),0) 'CR-news mistakes',

    NVL ()max()decode(t.entity | ) '-' | t.Flag,'Spend -new errors , t.TOTAL)),0) 'Autori-news mistakes'

    table t

    Group of t.transaction_dt, t.cntry_id, t.div_id;


    In the above how to get the sum total columns for this type of query hint.

    Help, please.

    Something like this maybe?

    SELECT transaction_dt,

    cntry_id,

    div_id,

    Sum(case when Entity = 'CR' and Flag = 'New Errors' Then total else 0 end) CR_New_Errors,

    Sum(case when Entity = 'Spend' and Flag = 'New Errors' Then total else 0 end) Spend_New_Errors,

    Sum(case when Flag = 'New Errors' Then total else 0 end) Total_New errors

    -... etc for all other combinations of flag and entity...

    From your_table

    Transaction_dt GROUP, cntry_id, div_id

  • Compare and display several column data according to requirement

    Hello

    I have a requirement where I want to compare the data in two tables and display only the columns if there is a gap using the sql query.

    Tell userid, e-mail and phone number of the same employee is stored in two tables. Now, I want to compare data from e-mail and phone number of the two tables and display the e-mail and phone number as if they are different data.

    Employee table:

    user_id E-mail phone
    emp01[email protected]00200
    emp02[email protected]

    00300

    emp03[email protected]00400

    Table user_details:


    ID user_email user_phone
    emp01[email protected]00201
    emp02(null)00300
    emp03[email protected]00401


    Please note that both tables have completely different column names and the data may contain a null as well. What I want to achieve is to compare the same employee data in both tables and display columns that have a different value of user_details table; as:


    user_id user_email phone
    emp01[email protected]00201
    emp02(null)
    emp03[email protected]00401


    As the table column names are different, I can't use a join and less to know the difference. I tried this with the help of CASES after the WHERE clause for comparison of columns multiple but GOLD or AND the two would defy the condition to display all columns with different data for the same line.


    How to do this without creating a separate view or a table that I don't have write access? Pointers would be useful.


    -Thank you.


    No need for something like

    You just run

    Select k.user_id, k.id,.

    e.email, u.user_email,

    e.Phone, u.user_phone

    of user_key_table k

    left outer join

    e employee

    On k.user_id = e.user_id

    left outer join

    user_details u

    on k.user_id = u.id


    the rest is here just to simulate your tables (I don't want to create tables in my APEX Tablespace as there are far too many people already)

    Concerning

    Etbin

  • You enter a value and tab out of af:inputListOfValues displays an incorrect value

    Hello. I have a problem with the autosubmit and tab off af:inputListOfValues in my code.

    Problem: When I type in a valid value and tab out of the field, it ignores the value, I entered and displays everything the first list in the result of the query instead regardless of the value that I typed.

    My code snippet. What it does is simply a search for employee LoV unattached to an attribute of the entity, and depending on selection, it displays the name of the employee within the page. (it also retrieves a table view what employee number came into office)

    < af:inputListOfValues id = "empNoId".

    popupTitle = "search and select: #{bindings." EmpNo.hints.label}.

    value = "#{bindings." EmpNo.inputValue}.

    label = "#{bindings." EmpNo.hints.label}.

    model = ' #{bindings. " EmpNo.listOfValuesModel}.

    required = "#{bindings." EmpNo.hints.mandatory}.

    columns = "#{bindings." EmpNo.hints.displayWidth}.

    shortDesc = "#{bindings." EmpNo.hints.tooltip}.

    Binding = "#{workLocationBean.txtEmpNo} '"

    partialTriggers = "id1".

    valueChangeListener = "{bean.onEmpNoChange}" "

    autoSubmit = "true" >

    < f: validator binding = "#{bindings." EmpNo.validator} "/ >"

    < / af:inputListOfValues >

    Other things to note:

    When I enter a valid employee number and click anywhere on the page (not TAB), it behaves properly.

    I tried to figure this out for days. Even my valueChangeListener Gets an incorrect value (when I do System.out) when I tab out, so I do not know where to catch them and replace it with the correct value.

    Thank you.

    This happens usually when the primary key is not defined in the view object used by LOV.

    Dario

  • Display a time column value

    Hey,.
    I'm trying to display a column value only once for a folder, not a static value. Changes in value and it can be a lot of values. I don't think that grouping will work since the Date value is dynamic. I use Oracle for Toad 10.5. There are 4 files with data from this trial.
    select Date, Person, Language, Country
    from TableA
    TableA
    Date            Person  Language   Country
    01/25/2013       James   English
    12/20/2012       James   English
                                         US
                                         AF
    Want to display only
    Date            Person  Language   Country
    01/25/2013       James   English
    12/20/2012  
                                         US
                                         AF
    Thanks for reading this thread!

    Published by: Nikki on January 7, 2013 13:08

    Hello

    You can use the ROW_NUMBER analytic function to see if a given line is the 1st row in a group and display only the columns of the person and the language when it is:

    WITH     got_r_num     AS
    (
         SELECT       dt          -- DATE is not a good column name
         ,       person, language, country
         ,       ROW_NUMBER () OVER ( PARTITION BY  person
                                      ,          language
                               ORDER BY          dt
                             )  AS r_num
         FROM      table_x
    )
    SELECT       dt
    ,       CASE WHEN r_num = 1 THEN person   END)     AS person
    ,       CASE WHEN r_num = 1 THEN language END)     AS language
    ,       country
    FROM       got_r_num
    ORDER BY  person, language, dt     -- If wanted
    ;
    

    Your front end, perhaps as a way of hiding these values when you want to. PAUSE function in SQL * more to it; I don't know if toad has nothing comparable.

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) where the query above generates erroneous results, and also after the good results you want from this 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 {message identifier: = 9360002}

Maybe you are looking for

  • Satellite Pro L300D SP5802 tools and BONES

    Hi guysI just bought a Toshiba Satellite Pro L300D-SP5802 laptop and it has Windows VistaI have havve 2 recovery DVD. One of these States for Windows XP Professional. I would like to know before all formatting: 1 XP Recovery DVDs will help me with th

  • Cannot find drivers Ralink Motorola BC4 Bluetooth HS adapter

    Original title: Ralink Motorola BC4 Bluetooth HS adapter I'm trying to transfer photos from my phone Motorola (V3) to my computer with a usb connection. But readers can be found by Windows Explorer. On the Site of Microsoft Compatability it says it s

  • Contexts of DONKEY?

    Is a DONKEY run exclusively in each apps own environment (user-space) or are just a few parts? What I was wondering if ExtensionInitializer is executed only once or it runs whenever an application uses the DONKEY. Certain functions can only be called

  • Choice of object fields

    I use an ObjectChoiceField that allows users to select what is displayed on the screen. The user can select an option and press return or trackball and I can use the selection to change the display. However, whenever I navigate away from the screen (

  • Entity displayed in the browser, but not displayed in the logic model

    HelloIn a drawing, I got myself in a situation where two entities are identified in the logic model of the browser, but are not as on the logical schema. I have created the entities, but removed later. However, when I engineer the logic of the relati