How to delete columns from a table

Hello

I have a 2D chart composed of 12 columns. I want to just use the first three columns within LabView. What is the best way to extract the data from these three columns?

Greetings

Kristoffer

You can watch from two different angles:

  • You can remove the extra columns
  • You can keep only the fist three columns

Would be easier to use "subset of the table" and select the first three columns. See photo.

(This assumes you want the three columns as a 2D array. If you want in three tables 1 d, you would use 'index array' resized to three exits.)

Tags: NI Software

Similar Questions

  • How to remove columns from the table on the master 1-0?

    I have an array of 96 columns with strings. I also have the array of int 96-elemets (mask) with 1 and 0.

    What I want to do is to is to remove (or hide - but I read that it is not possible) all the columns with index corresponding to 0 in the mask table.

    example:

    columns in the table

    1 2 3 4 5

    mask

    0 1 0 0 1

    I want to remove the columns 1, 3 and 4 and leave only 2 and 5 in my table.

    How can I do?

    If I create loop for with i as the index of the column, when I do DeleteTableColumns() columns number decreases, and I get an error of range out of

    Or do I have an option to hide the unnecessary columns (not set their width to 1, it's very ugly-looking)?

    Please help me (())

    Hello rovnyart!

    1. removal of columns in the table:

    I suspect that the reason why you get the out-of-range error is due to fact that in your loop, you delete the columns in the table, you'll eventually end up by referring to a column that no longer exists, because the other columns before it have been deleted. While you remove each column of your table in the loop for example, the column index number will move, because you deleted the other columns in front of her.

    To resolve this, even if you delete a column in your loop, make sure that you take also into account that the index of the column is moved because of the removed columns.

    2 hide columns in table:

    You can use the ATTR_COLUMN_VISIBLE attribute to hide columns in the table:

    http://forums.NI.com/T5/LabWindows-CVI-idea-exchange/add-attr-column-visible-attribute-for-table-Col...

    http://zone.NI.com/reference/en-XX/help/370051Y-01/CVI/uiref/cviattrcolumnvisible_column/

    3 alternatives:

    Note that another alternative would also use a tree instead, control as the tree control also supports the hidable columns:

    http://forums.NI.com/T5/LabWindows-CVI/table-hide-column/TD-p/569773

    Best regards!

    -Johannes

  • How to match columns from two tables with

    Hello:
    I have two tables as below:

    Table1::(Base Table)
    Country | Prefix | Prefix_Length
    Travel | 001 | 3
    CountryB. 0012 | 4
    PaysC | 00443 | 5
    CountryD | 0091 | 4

    :(Detail Table) table2
    The population | Area | Prefix
    500 | AreaA | 0015921
    1000 | AreaB | 00122
    400. AreaC. 00443743
    300. ALIS | 0091333
    100. AreaA | 001

    I need to match these two tables with prefix columns (whose length is not fixed in the two tables: but it starts with 00 in the two tables). Two different countries the prefix may be similar up to a certain length. Thus, Prefix_Length can be used to determine (exactly) how much time should be taken in the search of Table2.

    Output:
    Country | Prefix | Area | Population
    Travel | 001 | AreaA | 600
    CountryB. 0012 | AreaB | 1000
    PaysC | 00443 | AreaC. 400
    CountryD | 0091 | ALIS | 300

    Please help me with your valuable comments.

    -Tender

    Try this

    with base_table as (
                        select 'CountryA' country,'001' prefix,3 prefix_length from dual union all
                        select 'CountryB','0012',4 from dual union all
                        select 'CountryC','00443',5 from dual union all
                        select 'CountryD','0091',4 from dual
                       ),
       detail_table as (
                        select 10 no_of_call,'0015921' prefix from dual union all
                        select 3,'00122' from dual union all
                        select 50,'00443743' from dual union all
                      select 50,'00443643' from dual union all
                        select 300,'0091333' from dual union all
                        select 60,'001' from dual
                       ) 
    
    SELECT  country,
            prefix,sum(no_of_call)
       FROM (
             select  country,
            b.prefix,no_of_call,
            decode(no_of_call,lead(no_of_call,1,0) over(partition by no_of_call order by b.prefix,no_of_call),'y','n') y_or_no
      from  base_table b,
            detail_table d
      where b.prefix = substr(d.prefix,1,prefix_length))
      where y_or_no !='y'
      group by  country,
            prefix
      order by country,
            prefix;
    

    Published by: Vi on 20 February 2012 01:07

  • How to copy columns from one table to another

    Hai All


    How to copy the contents of the array to another

    For example, first name of the table is T1 and I have 10 columns and data are here and I need to create a table T2

    But I don't need the header, but not the values of all the 10 columns of T1 to T2, but not values


    Thanks and greetings

    Srikkanth.M

    Why not?

    create table test1
    as
       select * from emp
       where 1 = 2;
    

    Kind regards.

    LOULOU.

  • How to delete records from a table that has a composite unique key duplicate

    Hello
    I get the customer data from various sources in the staging of the table where I insert in the database table where the combination of two columns is considered as a unique key. But there is a possibility of duplicates. How to find duplicates in a SQL or pl/sql

    Thank you
    Manoi.

    Kassa,

    You can see the duplicates by using the following query...

    sql> select * from temp_rajesh;
    
          COL1       COL2 MESSAGE
    ---------- ---------- ------------------
           100        200 message
           100        200 message2
           300        400 message3
           400        500 message 4
    
    sql> select col1, col2, count(*)
      2     from temp_rajesh
      3       group by col1, col2
      4         having count(*) > 1;
    
          COL1       COL2   COUNT(*)
    ---------- ---------- ----------
           100        200          2
    

    -If in the case of duplicate records, you should see only the duplicates (according to some timestamp etc., you can use the functinon row_number analytic..)

      1  select col1, col2 from (
      2  select col1, col2,
      3         row_number() over (partition by col1, col2
      4                            order by message) rn
      5    from temp_rajesh)
      6*   where rn > 1
    sql> /
    
          COL1       COL2
    ---------- ----------
           100        200
    

    In the above example, I use message to order, you can replace it with activity_timestamp or the insertd_date according to your logic... when there are two records... one that you choose to duplicate.

    Thank you
    Rajesh.

    Published by: Rajesh Chamarthi on November 20, 2009 12:05 AM (added for example)

  • How to delete records from a table?

    It comes to my table structure:
    create table BILLS
    (
      bill_id    VARCHAR2(20),
      trx_no     VARCHAR2(20),
      item_code  VARCHAR2(3),
      amount     NUMBER,
      item_id    NUMBER,
      invoice_dt DATE
    )
    Here are some insert statements to populate the table. *(About a 100 of them, please Bear with me) *.
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104173960', '910873', '002', 432, 351, to_date('04-03-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104209800', '910873', '002', 432, 351, to_date('04-04-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104212747', '263156', '039', 230, 351, to_date('01-04-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104269414', '263156', '039', 230, 351, to_date('01-06-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104360446', '263156', '039', 230, 351, to_date('01-09-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104577673', '910873', '002', 432, 351, to_date('04-04-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104608668', '910873', '002', 432, 351, to_date('04-05-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104611586', '263156', '039', 230, 351, to_date('01-05-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104642560', '910873', '002', 432, 351, to_date('04-06-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104699154', '910873', '002', 432, 351, to_date('04-08-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104820820', '263156', '039', 230, 351, to_date('01-12-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104826028', '910873', '002', 432, 351, to_date('04-12-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104850631', '910873', '002', 432, 351, to_date('04-01-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104885554', '263156', '039', 230, 351, to_date('01-02-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104926901', '910873', '002', 432, 351, to_date('04-03-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104936656', '263156', '', 15, 247, null);
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104996320', '263156', '039', 230, 351, to_date('01-05-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105030104', '263156', '039', 230, 351, to_date('01-06-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105176803', '910873', '002', 432, 351, to_date('04-10-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105217998', '910873', '002', 432, 351, to_date('04-11-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105253306', '263156', '039', 230, 351, to_date('01-12-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105280152', '263156', '039', 230, 351, to_date('01-01-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105318072', '910873', '002', 432, 351, to_date('04-02-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105449712', '910873', '002', 432, 351, to_date('04-06-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105579048', '910873', '002', 432, 351, to_date('04-10-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105611201', '263156', '039', 230, 351, to_date('01-11-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105679991', '263156', '011', 196.56, 351, to_date('06-01-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105686749', '910873', '002', 432, 351, to_date('04-01-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105816473', '910873', '002', 432, 351, to_date('04-05-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105846525', '263156', '011', 230, 351, to_date('01-06-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105778111', '910873', '002', 432, 351, to_date('04-04-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104958496', '910873', '002', 432, 351, to_date('04-04-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105143695', '910873', '002', 432, 351, to_date('04-09-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104176755', '263156', '039', 230, 351, to_date('01-03-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104365552', '910873', '002', 432, 351, to_date('04-09-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104646837', '263156', '039', 230, 351, to_date('01-06-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104763596', '910873', '002', 432, 351, to_date('04-10-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104936656', '263156', '', 15, 247, null);
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105510930', '263156', '039', 230, 351, to_date('01-08-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104302780', '263156', '039', 230, 351, to_date('01-07-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104793590', '263156', '039', 230, 351, to_date('01-11-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104238583', '910873', '002', 432, 351, to_date('04-05-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105779115', '263156', '011', 230, 351, to_date('01-04-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104394481', '263156', '039', 230, 351, to_date('01-10-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105144934', '263156', '039', 230, 351, to_date('01-09-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105342823', '263156', '039', 230, 351, to_date('01-03-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105747780', '910873', '002', 432, 351, to_date('04-03-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105517258', '910873', '002', 432, 351, to_date('04-08-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105617909', '910873', '002', 432, 351, to_date('04-11-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104480711', '910873', '002', 432, 351, to_date('04-01-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105845480', '910873', '002', 432, 351, to_date('04-06-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105349031', '910873', '002', 432, 351, to_date('04-03-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105382599', '263156', '039', 230, 351, to_date('01-04-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104423263', '263156', '039', 230, 351, to_date('01-11-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104482370', '263156', '039', 230, 351, to_date('01-01-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104892872', '910873', '002', 432, 351, to_date('04-02-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105071771', '263156', '039', 230, 351, to_date('01-07-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105716829', '910873', '002', 432, 351, to_date('04-02-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105251149', '910873', '002', 432, 351, to_date('04-12-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105420465', '910873', '002', 432, 351, to_date('04-05-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105547036', '910873', '002', 432, 351, to_date('04-09-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105450806', '263156', '039', 230, 351, to_date('01-06-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105178143', '263156', '039', 230, 351, to_date('01-10-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105648407', '910873', '002', 432, 351, to_date('04-12-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105718070', '263156', '011', 230, 351, to_date('01-02-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104735083', '910873', '002', 432, 351, to_date('04-09-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105748707', '263156', '011', 230, 351, to_date('01-03-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104570555', '263156', '039', 230, 351, to_date('01-04-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105480249', '910873', '002', 432, 351, to_date('04-07-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104799512', '910873', '002', 432, 351, to_date('04-11-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105036878', '910873', '002', 432, 351, to_date('04-06-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105413781', '263156', '039', 230, 351, to_date('01-05-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105548204', '263156', '039', 230, 351, to_date('01-09-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104510445', '910873', '002', 432, 351, to_date('04-02-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104545120', '263156', '039', 230, 351, to_date('01-03-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104700608', '263156', '039', 230, 351, to_date('01-08-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104765006', '263156', '039', 230, 351, to_date('01-10-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105111984', '910873', '002', 432, 351, to_date('04-08-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105310993', '263156', '039', 230, 351, to_date('01-02-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105481415', '263156', '039', 230, 351, to_date('01-07-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105210719', '263156', '039', 230, 351, to_date('01-11-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105809981', '263156', '011', 230, 351, to_date('01-05-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104328833', '910873', '002', 432, 351, to_date('04-08-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104511904', '263156', '039', 230, 351, to_date('01-02-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105278905', '910873', '002', 432, 351, to_date('04-01-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104421567', '910873', '002', 432, 351, to_date('04-11-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104851866', '263156', '039', 230, 351, to_date('01-01-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105649424', '263156', '039', 230, 351, to_date('01-12-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104729022', '263156', '039', 230, 351, to_date('01-09-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105070358', '910873', '002', 432, 351, to_date('04-07-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104299829', '910873', '002', 432, 351, to_date('04-07-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104920099', '263156', '039', 230, 351, to_date('01-03-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104266551', '910873', '002', 432, 351, to_date('04-06-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104994904', '910873', '002', 432, 351, to_date('04-05-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104910999', '263156', '', 15, 247, null);
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104241418', '263156', '039', 230, 351, to_date('01-05-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104960203', '263156', '039', 230, 351, to_date('01-04-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105381371', '910873', '002', 432, 351, to_date('04-04-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104542458', '910873', '002', 432, 351, to_date('04-03-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104670160', '910873', '002', 432, 351, to_date('04-07-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105105026', '263156', '039', 230, 351, to_date('01-08-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104392347', '910873', '002', 432, 351, to_date('04-10-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104451005', '910873', '002', 432, 351, to_date('04-12-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104453960', '263156', '039', 230, 351, to_date('01-12-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104671563', '263156', '039', 230, 351, to_date('01-07-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104331181', '263156', '039', 230, 351, to_date('01-08-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105580192', '263156', '039', 230, 351, to_date('01-10-2010', 'dd-mm-yyyy'));
    It comes to my select statement.
    SELECT 
           Trx_No,
           Item_Code,
           Amount,
           Item_Id,
           MAX(Invoice_Dt)
      FROM Bills
     GROUP BY 
              Trx_No,
              Item_Code,
              Amount,
              Item_Id
    I want to remove the lines that are extracted from my select statement. What is the best way to achieve this?

    SELECT query sets.

    She literally takes

    delete from bills
     where (Trx_No,Item_Code,Amount,Item_Id,Invoice_Dt) in (select Trx_No,Item_Code,Amount,Item_Id,MAX(Invoice_Dt)
                                                              FROM Bills
                                                             GROUP BY Trx_No,Item_Code,Amount,Item_Id
                                                           )
    

    Concerning

    Etbin

  • How to remove a column from a table in a dell identtiymananger 7.0

    How to remove a column from a table in a dell identtiymananger 7.0

    Hello

    In Version 7 of the removal of a single custom column can be accomplished by a stored procedure, available in the database called: QBM_PColumnDrop

    Hope that helps.

    Cordially Fatih

  • Explicit cursor, column from several tables in a variable

    Here's the situation. This DB has tables of metadata. An example of table name would be g3e_attribute. Once you insert a record in a metadata table a trigger of executions insert and insert records in the g3e_attribute_0009 table (table of language, this is what I call it). It would insert in g3e_attribute_000C is the default language is the French. There is also a delete trigger so that if you delete a record in a table of metadata it deletes the corresponding language table. Well, somehow we have entered the language tables that are not in the metadata table. A problem with the system.

    There are 139 tables of language so I prefer not to do it manually.


    So I'm keen to make this code

    delete < table language > where < primary > not in (select < primary > in < metadata table >).

    So I need to loop through the table and and the corresponding primary keys.

    I have this code to get the table names
    Select table_name, substr (table_name, 0, (length (table_name)-5)) in all_tables where table_name like 'G3E_ % _000% ';

    This will display both the language metadata tale table names and.
    The table of language with either _0009 or _000C as a suffix, I take everything but the last 5 characters to get the table metadata.

    And I have the code to find the primary key of the table.
    SELECT column_name FROM ALL_CONS_COLUMNS A JOIN ALL_CONSTRAINTS C ON A.CONSTRAINT_NAME = C.CONSTRAINT_NAME WHERE 'G3E_LEGENDENTRY' AND C.CONSTRAINT_TYPE = C.TABLE_NAME = 'P ';


    So I just need to loop through all the tables. Put these pieces together, that's where I encountered a problem. I started to do a procedure, but I ran into a problem.

    When you loop, you move the record being the explicit cursor in a variable. Well, you can set the variable as a vertain column type (%), or type (%ROWTYPE) of the line. Although the sql I use to create the cursor takes columns from multiple tables and returns three columns. So I'm not sure how ot define the variable. The only work around I found was to make a table column_name that contains the table table,. Define the variable as rowType.

    Is there an easier way to do this?


    Thank you

    A couple of points.

    You should not really mix ansi joins and joins in the place where clause. Choose a style and stick to it.

    You can't do the DDL directly in pl/sql. You need to do this, use dynamic sql. something like:

    create or replace
    PROCEDURE SYNC_LANGMETATABLES AS
    
    CURSOR c_TABLE_PRIMARY IS
       select D.table_name, substr(D.table_name,0,(length(D.table_name)-5)),
              column_name
       from all_tables D,
          JOIN ALL_CONSTRAINTS C
             on C.TABLE_NAME = D.TABLE_NAME
          join ALL_CONS_COLUMNS A
             ON A.CONSTRAINT_NAME = C.CONSTRAINT_NAME
       where D.table_name like 'G3E_%_000%' AND
             C.CONSTRAINT_TYPE = 'P';
    
       v_LANGTABLE ALL_TABLES.TABLE_NAME%TYPE;
       v_METATABLE ALL_TABLES.TABLE_NAME%TYPE;
       v_PRIMKEY ALL_CONS_COLUMNS.COLUMN_NAME%TYPE;
    
    BEGIN
       OPEN c_TABLE_PRIMARY;
       LOOP
          FETCH c_TABLE_PRIMARY INTO v_LANGTABLE,v_METATABLE,v_PRIMKEY;
          EXIT WHEN c_TABLE_PRIMARY%NOTFOUND;
          execute immediate 'delete from '||v_langtable||' where '||v_PRIMKEY||
                            ' NOT IN(SELECT '||v_PRIMKEY||' FROM v_METATABLE)';
       END LOOP;
       CLOSE C_TABLE_PRIMARY;
    END;
    

    John

  • How to delete items from a cluster?

    Hello. I would like to know how to delete items from a cluster. I'm stuck with this problem. It has its own order of each element in a cluster. I tried to open a table, but it seems too complicated. In the attachment, I want to only get the data of 'flow' not 'pressure '. I try to use array programming, but it does not work. Would be nice if you help me to fix the file. Thank you

    Thank you very much. Your solution is way better than my confusing file.

  • How to delete photos from my i phone 6 but keep them on my i mac

    How to delete photos from my i phone 6 but keep them on my i mac os x

    peterfromcredin wrote:

    How to delete photos from my i phone 6 but keep them on my i mac os x

    And how does your photos get your iMac?

    Photo stream that you use?

  • histogram with just a few columns from a table

    I want to get a histogram of a few columns from a table (4 - 6-... 22)


  • Update multiple columns from multiple tables in a single UPDATE request

    Hello

    I'm trying to figure if I'm heading in the right direction.

    I want to update multiple columns from multiple tables in a single UPDATE request. Also, I would like to update multiple columns in a table from the tables.

    Scenario 1

    UPDATE Table2, Table 3
    SET T2.Column1 = T1.Column1 
    ,T2.Column2 = T1.Column2
    ,T3.Column2 = T1.Column2
    FROM Table1 T1, Table2 T2, Table3 T3
    WHERE T1.id = T2.id
    and T1.id = T3.id
    
    

    Scenario 2

    UPDATE Table3
    SET T3.Column1 = T1.Column1 
    T3.Column2 = T1.Column2
    ,T3.Column3 = T2.Column3
    ,T3.Column4 = T2.Column4
    FROM Table1 T1, Table2 T2, Table3 T3
    WHERE T3.id = T1.id
    and T3.id = T2.id
    
    

    Hello

    For scenario 1, you must write separate instructions UPDATE table2 and table3.

    To guard against someone else change one of these tables while you act so you can copy all relevant data in a global temporary table and update this global temporary table table3.

    ENGAGE only when two tables have been changed.

    You can write a procedure or an INSTEAD OF trigger to do all this.

    For scenario 2, you can reference many tables that you need when new table3.  It might be more efficient and simpler to use the MERGER rather than UPDATED.  For example:

    MERGE INTO table3 dst

    WITH THE HELP OF)

    SELECT t1.id

    t1.column1

    t1.column2

    t2.column3

    t2.column4

    FROM table1 t1

    JOIN table2 t2 ON t1.id = t2.id

    )             src

    WE (dst.id = src_id

    WHEN MATCHED THEN UPDATE

    SET dst.column1 = src.column1

    dst.column2 = src.column2,

    dst.column3 = src.column3,

    dst.column4 = src.column4,

    ;

  • How to remove columns from table form of process

    Hello

    I have a form of process UD_FN_USR. I have created a userid long type column and later the requirement has changed and I need to change the type of chain. I am able to remove the column from console design but in the table, the left column while I coulnt create the column with the same name as the type string, its tellling leaves the same name of column with a different data type in the current version or earlier versions.can someone please tell me how do to solve this problem

    You need to remove since the end of the database as suggested Sunny.

    ALTER TABLE DROP COLUMN UD_ABCD_UID UD_ABCD

  • Get columns from the table shown in the iterator

    Hello...

    I have the table in a collection of standard panel.  So, I can show/hide certain columns in the table using the columns in the view menu.

    Then I'm trying to do is export to excel (using apache poi) by looping through the table iterator.  What I can't do is search if the column is not displayed.  I don't want all the columns that are exported without worrying.  How can I achieve this?

    My bean is similar to the following for loop through the iterator:

    BindingContext bindingContext = BindingContext.getCurrent ();

    BindingContainer bindingContainer = bindingContext.getCurrentBindingsEntry ();

    DCIteratorBinding dcIteratorBinding = (DCIteratorBinding) bindingContainer.get ("EmployeesIterator");

    lines [] oracle.jbo.Row = dcIteratorBinding.getAllRowsInRange ();

    for (oracle.jbo.Row line: lines) {}

    {for (String colName: {row.getAttributeNames ())}

    output to excel cell here using row.getAttribute (colName) m:System.NET.SocketAddress.ToString)

    }

    }

    Thank you.

    Hello

    It's like ask the engine in your car to what colors the seats have. The iterator doesn't know anything about the visible state of a column. If the displayed columns must be determined from the table instance (richeTableau)

    The following article solves exactly the requirement that you have: Oracle ADF: Build Your Own it comes with a sample that you can download here: http://www.oracle.com/technetwork/issue-archive/2013/13-jul/o43adf-1940728.zip

    Have a look at CustomPanelCollectionBean.java:

    The method and code that you want to look for is:

    private String getRowHtml (row rw) {}

    StringBuffer rowHtmlBuf = new StringBuffer();

    Read visible columns in the table of the table instance. This way the

    PanelCollection can be used to show/hide columns and exclude

    printing to HTML

    Table richeTableau = this.getRichTable ();

    the list of columns determine the print attributes

    The list of columns in = table.getChildren ();

    int attrCount = columns.size ();

    rowHtmlBuf.append (this.addRowStart ());

    for (int i = 0; i)< attrcount;="" i++)="">

    for all visible columns, add columns to print

    If (((RichColumn) columns.get (i)) .isVisible ()) {}

    If (rw.getAttribute (i) instanceof ViewRowSetImpl) {}

    ignore the collections of detail used for master/detail example

    constraints in British Colombia ADF

    } ElseIf (rw.getAttribute (i) instanceof oracle.jbo.domain.Timestamp) {}

    shorten date to exclude the infromation times

    SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");

    String dateFormatString = sdf.format (((Timestamp) rw.getAttribute (i)) .getData ());

    rowHtmlBuf.append (this.addDataCell (dateFormatString));

    } else {}

    Prnt attribute values and if sure that null values don't raise a NPE. Add a white character to NULL

    attribute values

    rowHtmlBuf.append (this.addDataCell (rw.getAttribute (i)! = null? rw.getAttribute (i) m:System.NET.SocketAddress.ToString ():))

    " "));

    }

    }

    }

    rowHtmlBuf.append (this.addRowEnd ());

    Return rowHtmlBuf.toString ();

    }

    You need to access the Rich Table instance (for example using the JSF component binding) to then compare the attribute in the iterator with the visibility of the column

    Frank

  • How to delete data from the iPhone 5 c?

    How to remove data from my iPhone 5 c?

    What do you mean by data? Applications, photos, music??  It depends on what you're trying to delete.

Maybe you are looking for