Interesting question central to several columns

Hi all

To make several column pivot should I write as below?

Version: 11g

Select * from (

Select

col1, col2,... conN

de tab_1 v

join tab_2 hmd on V. col1 = HMD . col2

) pivot (

sum (risk012) a, sum(risk1224) b, sum(risk24) c

for ()col1, col2) == > what should I write here?

in ('100' as "riskkodu_100",   '101' as "riskkodu_101",   '102' as "riskkodu_102", ...... );

For multiple pivots of column, you must group the multiple pivots of value as an alias:

for (riskkodu, bildirimdonemi) in (('100', 'SomeBildValue1') as 'riskkodu_100', ('200', 'SomeBildValue2') as 'riskkodu_200'...)

Tags: Database

Similar Questions

  • How can I vote for an interesting question on the dedicated forum?

    Hello

    I know that Muse is a brand new application, but there are several relevant question - in my opinion - that should be considered first.

    After much navigation (!), I found a forum where you can vote for these interesting questions users have faced.

    Unfortunately, I'm unable to vote for one of theses messages if I am connected.

    Is there something to do to get this "right to vote"?

    I really want to participate in this improvement, just gimme the tools to do!

    Thanks for your response

    We know a few emails as of late in the ideas of the forums section and thus our Admin had turned off their.

    I have re-enabled them so you can vote and add ideas and apologize for the inconvenience.

    -j

  • Primary key several columns with Date - parameter problem

    All,
    I'm having a problem where I can not find the answer to. I looked upstairs and down nothing helps. Help, please.

    The issue is that I have a table that has a primary key of several columns and a column is a date, and the other is a string. I have a simple search and I want a picture update of the results table that users can click on and go to another page to update this record. The question is when I launch an appeal based on the updated image, I also want to define the settings based on the record that I have selected. So I put the string parameter and that works very well. The problem is with the date. When I put the setting date this market but he chops off the coast of the timestamp. Later when I try to access this setting "("dateParameter") pageContext.getParameter"; that it will bring a date as December 15, 2008 but I need the whole date and time stamp (i.e., December 15, 2008 10:20:33) to properly identify the record.

    Help, please!

    Thank you
    Colby J

    Hello

    because each parameter go into url as a format string, so you will never get the full date with timestamp setting, the solution would be to

    1.) set a fire on the photo update action, give his name to the event as "update."

    (2.) by clicking Update photograph fires this event.

    (3.) processFormrequest in the controller method

    OAApplicationModule am = pageContext.getApplicationModule (webBean);

    If ("update".equals (pageContext.getParameter ("event")))
    {
    This will give you the select line when you click Update

    String rowReference = pageContext.getParameter (OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    Line VORowImpl = (EmployeeSummaryVORowImpl) am.findRowByRef (rowReference);
    Timestamp sdateVal = (String) row.getAttribute ("Date value");

    This will transfer the values to the next page
    pageContext.putTransactionTransientValue ("transferdvalue", sdateVal);

    }

    and in the next page, you can get the value as follows

    timestamp getDateVal = pageContext.getTransactionTransientValue ("transferdvalue" l);

    hope this will solve your problem, please let me know if you face any problem

    thanx
    Pratap

  • only get a single photo on board contact despite the selection of several columns.

    When you select the photo and contact sheet then, there is only a single photo in the upper left column. Unable to get several copies despite the selection of several columns.

    The contact sheet shows only the photos you selected in the library before going to the page of Contacts.

    If you want to have multiple copies of the same image, you need to duplicate this image enough times so that you get the number you want on the contact page.  Select the thumbnail and use the key combination command + D to duplicate the photo.

    Select all duplicate images, and then go to the Contacts option in the printing process.

  • Update of several columns on multiple tables

    Hello

    I try to update several columns on two different tables, and I would like to know how to proceed in a SQL statement.

    I have the data I want to update in this SQL statement...

    #####################################

    Select srv. X_SERVICING_DEALER as 'The merchant name', -(want to update this column)

    SRV. X_SERVICING_SITE as ' dealer # ', -(want to update this column)

    dlrx. ATTRIB_50 'Région',--(tiens à mettre à jour cette colonne)

    dlrx. ATTRIB_49 as 'District', -(want to update this column)

    DLR.x_zone_cd as 'Zone'-(want to update this column)

    Of

    s_srv_req srv,

    s_org_ext dlr,

    s_org_ext_x dlrx

    where dlr.row_id = srv.pr_con_org_id

    and dlr.row_id = dlrx. par_row_id

    and srv.row_id = 1-1RSEXAV';

    #####################################

    Any guidance would be appreciated.  Thanks in advance.

    Chris

    > I'm trying to update several columns on two different tables, and I would like to know how to proceed in a SQL statement.

    You can not.  Only one table can be updated at the same time.

  • How to load several columns of data into Essbase

    Hello!

    I need to download a flat in Essbase data file, but this file contains data for each month in a separate column (Jan, Feb and March), it has several columns of data in the source file, while the DATA reversed Essbase data store is a fact with a column of the data table. So I'm stuck on the way in this case to map more than one column of data in the source file to column 1 of the target data.

    Thank you very much!

    When yo reversed your essbase data model in the RKM there will be an option called SEVERAL COLUMNS of DATA (no default value), this must be set to yes. Then, there are 2 other options that need to be addressed DATA_COLUMN_DIMENSION which is the name of the dimension that you load multiple values to in your case period. Then in the next option DATA_COLUMN_MEMBERS specify you a comma list of members separated... column data required i.e. Jan, Feb, Mar etc. Now when you reverse the model, you will have several column data members

  • How to get a separate account of several columns

    I've done this before and I'll darn why I don't remember this.

    A table with 3 columns with the primary key defined in the column.

    Line a, b and c
    NUM.
    1 020 how abc
    2 why 030 def
    3 010 no IGS
    4 how 040 abc
    Yes def 5 050
    6 060 why def

    So what I want is a number of unique values to columns b and c as if b and c were in fact a field.

    So the result of the query:
    Count = 4 unique lines.

    I hope I make some kind of sense. It is a bit much to know if the number of occurrences of each duplicate value, I know not just get the number of unique lines of lines not indexed will be enough. Because the query is supposed to be universal for several digital and alphanumeric data columns and can be extended for several columns, I'm just trying to get a basic skeleton which works for an analysis "on the fly".

    It will be useful.

    SQL>create table rb as select rownum A, rownum b , rownum c from dual connect by level < 11;
    
    Table created.
    
    Elapsed: 00:00:00.31
    SQL>select count(distinct a) from Rb
      2  union all
      3  select count(distinct B ) from Rb
      4  union all
      5  select count(distinct c) from Rb
      6  /
    
    COUNT(DISTINCTA)
    ----------------
                  10
                  10
                  10
    
    Elapsed: 00:00:00.53
    SQL>update rb set b = 3 where B > 5;
    
    5 rows updated.
    
    Elapsed: 00:00:00.26
    SQL>commit;
    
    Commit complete.
    
    Elapsed: 00:00:00.26
    SQL>select count(distinct a) from Rb
      2   union all
      3   select count(distinct B ) from Rb
      4   union all
      5   select count(distinct c) from Rb
      6   /
    
    COUNT(DISTINCTA)
    ----------------
                  10
                   5
                  10
    
    Elapsed: 00:00:00.53
    SQL>
    
  • question of div multi-column

    I would like to create a section in my container of unique column have several columns.
    Since DivElement is a subclass of ContainerFormattedElement I thought it would be a good starting point.

    I would like to make the div 2 columns in the first place, column one inlineGraphic and in the second column, place a few lines of text length/br/duration/br/span.

    The difficulty seems to be...
    How can I get the different columns for a div over the entire TextFlow?
    How to indicate where the column should break up (after the InlineGraphic)?

    This whole thing could disappear if we simply float working with InlineGraphic, but that doesn't seem to be abytime soon, so this would be a viable solution for the moment.

    The attached markup was generated by the help of actionscript code and export via TextFilter...
    Any thoughts?

    Is anyone out there?
    Thank you
    Tim

    DivElement does not support the columns - although I think it should one day, that is why the API is suggestive. I think it would be possible to emulate it, but should enter the text of the two TextFlows. Text stream via the first container, thentake overflow text and copy it to a second casting that would elapse in the second container.

  • Need for the sql query to have several columns in a single coulumn

    Hi all

    I need create the query to have several columns in a single column with several lines.

    Select a.customer_trx_id, a.previous_customer_trx_id
    of ra_customer_trx_all one
    where a.customer_trx_id =: customer_trx_id

    Here, a.customer_trx_id and a.previous_customer_trx_id are in two columns. I need to put them in a single column.

    Say: the foregoing is output
    --------------------------------------------------------------------------------
    a.customer_trx_id a.previous_customer_trx_id

    --------------------------------------------------------------------------------
    123456 87654

    --------------------------------------------------------------------------------

    Need for a single column

    As


    --------------------------------------------------------------------------------
    123456
    87654

    --------------------------------------------------------------------------------

    Please do the needful. Please note that it is not the UNION.

    Thank you
    Abdul

    Hello

    You want a way to confirm that what looks like two rows is really a line?

    Here are three ways:

    (1) count the lines:

    WITH  my_original_querry     AS
    (
         select  a.customer_trx_id || CHR(13)
                          || a.previous_customer_trx_id     as id
         from      ra_customer_trx_all     a
         where      a.customer_trx_id      = 274881
    )
    SELECT     COUNT (*)
    FROM     my_original_query;
    

    (2) in SQL * Plus, have SQL * more count them for you:

    SET     FEEDBACK     1
    
    select  a.customer_trx_id || CHR(13)
                     || a.previous_customer_trx_id     as id
    from      ra_customer_trx_all     a
    where      a.customer_trx_id      = 274881;
    

    (3) implicitly count them with the ROWNUM Pseudo-column

    select  a.customer_trx_id || CHR(13)
                     || a.previous_customer_trx_id     as id
    ,     ROWNUM
    from      ra_customer_trx_all     a
    where      a.customer_trx_id      = 274881;
    
  • What's the point of having several columns in the ORDER BY clause?

    DB version: 10 gr 2

    When you use the ORDER BY clause, the lines are always sorted by the first column in the ORDER BY clause. So, what's the point of having several columns in the ORDER BY clause (I always see this in production codes)?

    For the below SQLs' schema SCOTT, result sets are always classified according to the first column ename. When I added use asc and desc of employment, does not change the result set.
    SQL> select * from emp order by ename;
    
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
    ---------- ---------- --------- ---------- --------- ---------- ---------- ----------
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    20
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7839 KING       PRESIDENT            17-NOV-81       5000                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    20
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
    
    14 rows selected.
    
    SQL> select * from emp order by ename, job;
    
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
    ---------- ---------- --------- ---------- --------- ---------- ---------- ----------
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    20
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7839 KING       PRESIDENT            17-NOV-81       5000                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    20
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
    
    14 rows selected.
    
    SQL>  select * from emp order by ename, job desc;
    
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
    ---------- ---------- --------- ---------- --------- ---------- ---------- ----------
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    20
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7839 KING       PRESIDENT            17-NOV-81       5000                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    20
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
    
    14 rows selected.

    Search in this example, you will see the difference

    SQL> create table test_order (name varchar2(10), surname varchar2(10), age number);
    
    Table created.
    
    SQL> insert into test_order values('Kamran','Agayev',26);
    
    1 row created.
    
    SQL> insert into test_order values('Kamran','Taghiyev',26);
    
    1 row created.
    
    SQL> insert into test_order values('John','Kevin',23);
    
    1 row created.
    
    SQL> select * from test_order;
    
    NAME       SURNAME           AGE
    ---------- ---------- ----------
    Kamran     Agayev             26
    Kamran     Taghiyev           26
    John       Kevin              23
    
    SQL> select * from test_order
      2  order by age;
    
    NAME       SURNAME           AGE
    ---------- ---------- ----------
    John       Kevin              23
    Kamran     Agayev             26
    Kamran     Taghiyev           26
    
    SQL> select * from test_order
      2  order by age asc, surname desc;
    
    NAME       SURNAME           AGE
    ---------- ---------- ----------
    John       Kevin              23
    Kamran     Taghiyev           26
    Kamran     Agayev             26
    
    SQL>
    

    When in the second query, I sorted out only for age, you saw it there two 26 years old Keita, there was first Agayev, then Taghiyev. But if I want to get the family names in descending order when there are two very old person, then I will add the second column in the order by clause

    - - - - - - - - - - - - - - - - - - - - -
    Kamran Agayev a. (10g OCP)
    http://kamranagayev.WordPress.com

  • Get the number of DISTINCT from several columns

    How can I get the number of DISTINCT from several columns?
    SQL> select count(distinct ename) from emp;
    
    COUNT(DISTINCTENAME)
    --------------------
                      14
    
    SQL> select count(distinct ename, job) from emp;
    select count(distinct ename, job) from emp
           *
    ERROR at line 1:
    ORA-00909: invalid number of arguments

    Hello

    select count(distinct ename || job) from emp;
    

    Kind regards

  • update of several columns of values in another table

    Hello

    I have two tables in a database of 11 GR 2 that contain similar data. There is no FK relationship between the two tables, and for now, I need the data in MASTER to match what is in the SECONDARY. Table data types are the same with the same length.

    Table 1 is called MASTER and columns are:
    MTID
    ADDRESS1
    ADDRESS2
    CITY

    Table 2 is called SECONDARY and columns are:
    SDID
    ADDRESS1
    ADDRESS2
    CITY

    MID and SID are the same on both, but the rest of the columns may be the same or in some cases are different.

    I ran the following query that lets me know there are 20 k odd rows that have different data in these lines (I'm not at work at the mo so do not have the exact query I ran or table column names, but it's close enough).
    select
    m.address1 as maddress1,
    s.address1 as saddress1,
    m.address2 as maddress2,
    s.address2 as saddress2,
    m.city as mcity,
    s.city as scity
    from master m, secondary s
    where m.mtid = s.sdid
    and m.address1 != s.address1
    or m.address2 != s.address2
    or m.city != s.city
    /
    I need to update the rows in the master of secondary school where these values are different. I tried a few different queries updated with no luck.

    I want to do something like
    update m.address1
    set m.address1=s.address1
    where m.address1 != s.address1
    and m.mtid = s.stid;
    But I want to update columns address1 and address2, city of master.

    Any ideas on how I can do this? After you run the update results of my select query should return no rows.

    Thanks in advance and I hope that the question made sense.

    1008991 wrote:
    I got a similar error as well:

    update master m
    set (sm_user_addr_1, sm_user_addr_2, sm_user_city, sm_user_postal_cde)
    = (select sm_user_addr_1, sm_user_addr_2, sm_user_city, sm_user_postal_cde
    from secondary s
    where s.sd_key = m.sm_key
    )
    where exists (
    select 1 from secondary s
    where s.sd_key = m.sm_key
    and (s.sm_user_addr_1     != m.sm_user_addr_1 or
    s.sm_user_addr_2     != m.sm_user_addr_2 or
    s.sm_user_city       != m.sm_user_city   or
              s.sm_user_postal_cde != m.sm_user_postal_cde));
    
    ERROR at line 3:
    ORA-01427: single-row subquery returns more than one row
    

    It simply means that you have several lines with the same sd_key for a given sm_key.
    Is that you have secondaries for one master. You must choose only one line
    If you need additional terms in your where clause

    select sm_user_addr_1, sm_user_addr_2, sm_user_city, sm_user_postal_cde
               from secondary s
             where s.sd_key = m.sm_key
    
  • Quick question: alter table, alter column NOT NULL...

    Hey all,.

    If I change 3 populated (they have data) columns in a table with about 300 million of NULL lines that is NOT NULL:

    alter table blah
    change (col1, col2, col3 NOT NULL NOT NULL, NOT NULL);

    ... about cela "will take a long time?

    I know that it is a question REALLY of high level, but I wonder how long it should consume (a few minutes or several minutes - looking for an approximate answer as well). The table has 10 columns, if that helps.

    Hardware specifications are not relevant... I am looking for a basic response.

    Hello

    Plug material is relevant here.
    It depends on the material/Oracle parameters/IO etc..
    You can also view v$ session_longops to track progress.

    Concerning
    Anurag Tibrewal

  • iOS 10 questions implementation of several devices on Home App (HomeKit) for use with Hub of HUE.

    I can connect an iPhone but am unable to allow a guest or a second iPhone to the visionaries. Once I'm Setup on an iPhone, the second iPhone will not see the hub of HUE with their application to the home page. When I send an invitation for comments and they accept, they see my Home Setup, I created, but they get an error message saying ' accessories does not.

    I rest iphones and TINT Hub several times as well as home App and TINT settings. I'm still able to install one of the two iPhones at the start. The problem comes when you try to grant the second iPhone controls. I even tried to remove the TINT Apps to ensure that they do not interfere in some way. Both devices are able to use the application of COLOUR very well to control the lights, but we would like both the convience to control the lights of HUE with iPhone Control Center.

    Someone at - it stories of success with the connection of multiple devices using the Hub of HUE and Apple Home App for iOS 10 release?

    Both devices are iPhone 6 Plus running iOS 10. I have an iPad Pro available, but it is not setup for iOS 10 again or used for lighting control. The Hub of HUE is the latest model of square.

    Thank you!

    I have exactly the same problem.  My iPhone 6 s + works fine.  My children and wife iPads, iPods and phones running iOS10 are not.  They can see the app home screen and all the features of the installation.  But each device says "no response" and at the top of the page its says "no responding accessories".

    In addition, they can all use the app of Hue and set the lights very well.  However, not with Siri, but that's another question.  Once again my siri controls function very well.

    My guess is it's a bug.

  • script process of sorting (with several column data) and average (some other column data)

    Hello

    I had a lot of help from my log of the bus data, previously.

    My interest now is to sort them according to certain values of the column and then get an average result of them.

    Given that the tiara doesn't seem to support the triage function after loading data, it seems to be a difficult issue for me;

    It would be useful that I can get all related index/approach/function/Council to do this kind of script.

    I've attached a file excel for example.

    In the first "raw" sheet, there are rows of raw data with column names of "year, month, day, ID, ID2, point, condition.

    Actual data had many more columns, but I simplified it for convenience.

    What I try to do is, with the entry (from DialogBox or simply a script as a variable; I can do this) 'year' and 'months' (e.g.: 2015, 6).

    to get the resulting data sheet 'expected results '.

    The result is sorted by value 'ID' and 'condition '. 'Condition' is 0 or 1, then the average of the values of 'point' for each ID and the condition is obtained.

    Group for the 'condition' of 2 will be the average of the results of the 'condition' 0 and 1 (collection of data). (So there are always three groups: for 'condition', 0, 1, and 2.)

    Currently, 'ID' includes 12345 and 54321, but there may be more values, too.

    "Num" column is the number of files RAW allows to get the average for the corresponding 'year-month-ID-condition'.

    Is there an effective approach or the function that you recommend?

    I think that you may need more details for example data, so please do not hesitate to ask me.

    Thanks in advance.

    Inyoung

    The interactive part to modify data in DIAdem is collected in the 'ANALYSIS' left aon tab.

    The second entry, 'Functions of channel' contains 'Values of Channel sorting' method.

    To automate this process, it is possible to use the macro recorder in the tge script module.

Maybe you are looking for

  • Library &gt; com.apple.mail folder?

    I'm somehow more disk space on a mac air and I see GB 116 in my LIBRARY with 66 GB in support of the request, 14 GB and 29 GB in the Mail folder in the folder the user com.apple.mail. Anyone know about this? Thank you

  • mail application opens randomly

    At the end of the day, I close all applications.  New morning the Mail application is open.  I've recently updated to El captain.  This problem happened when I was with Lion.

  • Suggestions please.

    What is the best protection software (virus, software malicious internet etc.) for a 2015 (8 GB) Macbook pro using El Capitan? I would be grateful someone who has used the software to meet. Thank you.

  • My backup on a NAS system in a separate Ethernet environment takes about 30 hours for 222GB

    Hello someone has an idea how spee the backup process. Most of the time the transfer charge is not in MB/s but kb/s, The NAS system is able to transfer 50 MB/s via an ethernet port matched. But time machine is a pain. Anyone has a better solution

  • Phoneclean deleted my photos and my videos.

    I tried to erase the storage on my iPhone 6, I used phoneclean, he slightly blotted out most of my iPhone says library.my yet there are 1.8GBs but there are only 40 photos and videos. I really want to get back them. help please.