Multiplex several columns in a

Hello

This seems to be a pretty basic question, but I fight so he can work.

I want to take a matrix (1) and convert it into an another Matrix (2) where Matrix (2) will have 1 column which is derived from the concatenation of column 1, followed by column 2... matrix etc. (1).  Thus the Matrix (2) will have more items by column but fewer columns than Matrix (1)

All, that is the case, is essentially multiplexing a few lines from the Matrix (1) in a new column in the matrix (2).

Thank you.

Yes.  Do you need a transposition table before the remodeling.

First function Array subset is down to 3 columns.

Convert a 2D array.

Table size and multiply elements in the array to get the total number of items in the table.

Reshape the table

Tags: NI Software

Similar Questions

  • 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.

  • 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'...)

  • 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>
    
  • 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;
    
  • 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

  • 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
    
  • How to display several column data in an Oracle SQL column

    Hello

    I have the table t1 and (a1, a2, a3) are columns

    I have this request

    Select the t1 a1
    Union
    Select a2 from t1
    Union
    Select a2 from t1

    This is the variant is unpivot, but he calls internal table several times.

    I wish in a way, where I want the same output, but the appeal of the table only once.

    Thank you
    Sunil Jena

    Published by: 990324 on March 15, 2013 04:46

    Assuming a1, a2 and a3 have the same data type:

    select  case lvl
              when 1 then a1
              when 2 then a2
              else a3
            end
      from  t1,
            (
             select  level lvl
               from  dual
               connect by level <= 3
            )
    /
    

    SY.

  • Mapping of several columns in the source in 1 target with the source Excel file

    Hello

    I use to load Excel files in HFM FDM 11.1.2.1.
    In Excel, I had 3 columns that need to be mapped in 1 column target using a few rules and mappings. Forest to source file should work in all cases.

    For example,.

    Source:
    A, B AND C
    1 company 1 xxx
    2 yyy Company2
    1 Company3 zzz

    mapping for B:
    Company 1 C1
    C3 Company3

    mapping for C:
    C2 Company2

    target after confirming:
    C1
    C2
    C3

    I take data from B or C according to data in A (1 or 2).


    I found several ways to do so, but they are not perfect:

    1 map columns B and C to the correct value (#C1, C2) and use scripting conditional on a column (for value correctly mapped either column B or C).
    The problem here is that I can not break through the low PIF when B and C are mapped to values other than [none]. Can this been bypassed?

    2 use DataPump import Scripts for concatenating the sources in one column only and use the tables mapping standart on 1 column.
    The problem is that DataPump import Scripts do not work with the source files Excel. Is this correct? I could find a word in the documentation...

    3. map columns B and C [None] script well but fat on the column, as:
    If (varValues (13) = '1' and varValues (39) = "Company1")) then
    Result = "C1".
    ElseIf...

    Which is horrible, and it would be very difficult to add new mappings in the script. But it works.

    4. logical accounts. I can't use it I need to drill down.

    Could you recommend me some better way to do this simple task to work?

    It's a bit that I coded something like that in VBA, so you will need to do a bit of cleanup; However, it should get you well in a way that might work...

    Why not add a formula in the excel file, once it is downloaded? (I guess the excel file that is being loaded is not something that you could develop a formula to start?)

    on error resume next 'make sure all commands are executed.  If something happens in code and file is open, we don't want to leave it open...
    
    Set objExcel = CreateObject("Excel.Application")
    Set objWorkbook = objExcel.Workbooks.Open("")
    Set objworkSheet = objWorkbook.Sheets("")      'OR you could use ordinal
    
    objExcel.Application.DisplayAlerts = False
    objExcel.Application.Visible = false
    
    for x = 1 to 100   'I'm just doing a loop for the sake of doing a loop.  You might want to loop through rows and for each row that has a
          'value in col A, make the formula and then break out of loop so you don't add a metric ton of unnecessary formulas
        objworksheet.Cells(x, "C").Formula = "=A" & x & " + B" & x      'i.e. =A1+B1
    next 
    
    'Save the changes
    objWorkbook.Save 
    
    'Close the workbook
    objWorkbook.Close
    
    'Quit application  (important)
    objworksheet = nothing
    objworkbook = nothing
    objExcel.Application.Quit
    objexcel = nothing
    

    NOTE: Microsoft DOES NOT officially support office (i.e. what we do above and what of FDM backstage I guess) seems to work very well, but in most cases, etc.. Be careful about cleaning to ensure that all memory is released and that the instance of excel stops.

  • How to get the checksum for several columns?

    I need to compare the data of a record in a data table in another table. The structures of the two tables are not the same, but the data types of the columns I'm comparing cam is obviously the same. There are many columns so I thought that a shortcut to make a crazy long A = A AND B = B, etc... several dozens of times to check if the data are different each time was to use checksum.

    I had planned to use the concatenation of all the columns together in a single string, delmitted by a semicolon.

    However, I find that it does not work as desired. The checksum produces the same number for different values of data. So I need ot use something else.

    There is another function I could use in a similar way where it will create a compact, unique hash to a concatenated string of time I spend?

    And what is the data type of the return value - hoping that it's digital!

    What checksum algorithm do you use?

    Depending on the version of Oracle, you can use the HASH of the package DBMS_CRYPTO method, i.e.

    SELECT dbms_crypto.hash( to_clob( ename || empno || sal ),
                           1 /* dbms_crypto.hash_md4 */ )
      FROM emp
    

    A MD4 hash should have a very low incidence of collisions of normal data even if it isn't particularly cryptographically course. You can also use the ORA_HASH method

    SELECT ora_hash( ename || empno || sal )
      FROM emp
    

    but I expect the chance of collisions to be a little higher.

    Justin

  • Unique table with several columns or several tables split?

    What is the best.

    A table with multiple columns inside or divided into several tables. Why?
    How will the performance in the two scenarios?

    Hello

    user13024762 wrote:
    I have a table EMP that has column EMP_ID, EMP_NAME MGR_ID, MGR_NAME, SALARY, EXP_IN_MNTHS, EXP_IN_YRS... etc with multiple columns

    I have the following tables
    EMP-> EMP_ID, EMP_NAME

    Each row in the table emp thie represents a separate employee. I guess other columns in the emp table might be birth_date, social_security_number and status (by example, 'Active', 'Leave', 'complete'). Here's what an employee has (at least) one of. If there is a one-to-many relationship between an employee and an attribute, then you probably want another table for this attribute.

    BISHOP-> EMP_ID, MGR_ID, MGR_NAME

    There is a one-to-many relationship between employees and managers? In other words, an employee may have 2 or more managers? If Yes, then you need another table.
    If there is only a one-to-one relationship between employees and managers (in other words, if an employee is never more than 1 Manager) so why don't you just have a mgr_id column in the emp table?
    Managers are also used for? (This is often the case, as in scott.emp and hr.employees.) If so, do not store their names in the EME and tables of mgr. Store name (and date of birth and other information) in the table emp only and, if you need a table of Bishop, just the emp_id and mgr_id column.

    SAL-> EMP_ID, SALARY

    There is a one-to-many relationship between the employees and wages? In other words, an employee may have 2 or more treatments? If so, how will you use the values? Is a special treatments in some way, as it will be used more often than others? (In other words, you may have a current and past wages salary, but the last wages are rarely used.)
    If you never have more than 1 salary for a given employee, why not just have a sal column in the emp table?

    EXP-> EMP_ID, EXP_IN_MNTHS, EXP_IN_YRS

    There is a one-to-many relationship between the employees and what whether you store in this table?

    etc. with more tables

    What is the best based on

    (1) performance and data recovery
    (2) ease of use
    (3) maintainability

    A one-to-many relationship requires an additional table. If an employee can have up to 3 managers, don't have mgr1, mgr2 and mgr3 columns in the emp table. Use a separate table, with up to 3 lines for the same employee, instead.
    For 1-1 relationships, it is usually best to not have separate tables.

Maybe you are looking for