Oracle 8i vs Oracle 9/10: Group by and order of returned rows

Hello people,
I've searched the forum for threads on this topic: the order of returned rows in queries which have a GROUP BY clause, and found out that Oracle states that GROUP BY clause does not guarantee that the order of returned rows will be the same every time nor the rows will be ordered someway. I've confirmed this information in the Oracle documentation for the GROUP BY clause for Oracle 9 and 10. But I couldn't find the same in the Oracle 8 documentation (SQL Reference), in which the GROUP BY clause section does not mention anything about the order of returned rows in queries which have a GROUP BY (except for something about using a GROUP BY and a HAVING clause together, which is not helpful in this situation).
Besides, I have an Oracle training book: "Introduction to Oracle: SQL and PL/SQL" for Oracle 8, where the GROUP BY clause is said to perform a default ordering, here is the text:
"By default, rows are sorted by ascending order of the columns included in the GROUP BY list. You can override this by using the ORDER BY clause".
So, I need to find out if Oracle 8 GROUP BY clause did some kind of sorting over the returned rows as it is said in the training book and if this behavior changed in Oracle 9. And more important: where to look for to find documentation about this change.
Thank you, guys, I really hope someone could help me with this.
Fer.

And this statement from Tom (taken from the link above) says more about why the sort (even when done because of group by) should not be relied upon:
<quote from="asktom link above">
and even when it does sort as a by product of its processing, the sort is a
BINARY SORT, not your sort (with your language and character set)
</quote>

Similar Messages

  • Sqlserver query using Group by and Order by

    SUM(BILL_DETAIL.x_bill_quantity) as BILL_QUANTITY,
    MIN(BILL_DETAIL.x_billable_to) as BILLABLE_TO,
    MIN(BILL_DETAIL.x_billable_yn) as BILLABLE_YN,
    AVG(BILL_DETAIL.x_bill_rate) as BILL_RATE,
    MIN(BILL_DETAIL.x_cost_rate) as COST_RATE,
    MIN(BILL_DETAIL.x_cost_total) as COST_TYPE,
    LISTAGG(BILL_DETAIL.objid, ',') WITHIN GROUP(ORDER BY BILL_DETAIL.objid) as ID_LIST
    FROM table_x_gsa_bill_detail BILL_DETAIL
    WHERE (1=1)
    GROUP BY (DECODE(BILLABLE_YN, 1, 'Billable', 'Non-Billable') || ',' || BILLABLE_TO || ',' || DETAIL_CLASS || ',' || COST_TYPE || ',' || BILL_RATE)
    ORDER BY DECODE(BILLABLE_YN, 1, 'Billable', 'Non-Billable') || ',' || BILLABLE_TO || ',' || DETAIL_CLASS ||
    ) dt WHERE rn BETWEEN 0 AND 1
    Can any one pls help me using of Case Condition keyword instead of Decode in the above query ??? iam not able to convert above query for group by and order by..
    Actually i need to do group by the aggragate values which i got the values from the fields of BILLABLE_YN,BILLABLE_TO,DETAIL_CLASS, COST_TYPE, BILL_RATE.
    where as in oracle i can run above query using decode keyword where as in sqlserver iam not able to use BILLABLE_YN field alias of above query in group by .
    i tried like by using following way but it is wrong because here iam not using aggragate values of fields in group by funtion please help me in converting query in sqlserver. GROUP BY (case BILLABLE_YN when 1 then 'Billable' when 0 then 'Non-Billable' else
    'Non-Billable' End BILLABLE_YN + ',' + BILLABLE_TO + ',' + DETAIL_CLASS + ',' + COST_TYPE + ',' + BILL_RATE)
    Krishna

    CREATE TABLE DETAIL
    ([objid] int,[x_billable_to] varchar(19), [x_bill_quantity] int,
    [x_billable_yn] int, [x_bill_rate] int, [COST_TYPE] varchar(19) )
    INSERT INTO
    DETAIL
    ([objid], [x_billable_to], [x_bill_quantity], [x_billable_yn], [x_bill_rate],[COST_TYPE])
    VALUES
    (1, 'Customer', 3, 1, 20,'Parking'),
    (2, 'Customer', 1, 1, 25,'Toll'),
    (3, 'Customer', 2, 1, 20,'Parking') 
    Pls convert following query for executing query in sqlserver  ..for the column ID_List it should return data like 1,2,3
    SELECT * FROM (SELECT 1 rn,
            SUM(BILL_DETAIL.x_bill_quantity)      as BILL_QUANTITY,
            MIN(BILL_DETAIL.x_billable_to)        as BILLABLE_TO,
            MIN(BILL_DETAIL.x_billable_yn)        as BILLABLE_YN,
            AVG(BILL_DETAIL.x_bill_rate)          as BILL_RATE,
            LISTAGG(BILL_DETAIL.objid, ',') WITHIN GROUP(ORDER BY BILL_DETAIL.objid) as ID_LIST
         FROM   BILL_DETAIL
          WHERE (1=1)
     GROUP BY (DECODE(x_billable_yn, 1, 'Billable', 'Non-Billable') + ',' + x_billable_to  +  ',' + COST_TYPE + ',' + x_bill_rate)
          ORDER BY DECODE(x_billable_yn, 1, 'Billable', 'Non-Billable') + ',' + x_billable_to  +  ',' + COST_TYPE + ',' + x_bill_rate
           )dt 
    WHERE rn BETWEEN 0 AND 1
    Krishna
    sounds like this
    SELECT *
    FROM
    SELECT 1 rn,
    SUM(BILL_DETAIL.x_bill_quantity) as BILL_QUANTITY,
    MIN(BILL_DETAIL.x_billable_to) as BILLABLE_TO,
    MIN(BILL_DETAIL.x_billable_yn) as BILLABLE_YN,
    AVG(BILL_DETAIL.x_bill_rate) as BILL_RATE,
    LEFT(bd1.ID_LIST,LEN(bd1.ID_LIST)-1) AS ID_Listing
    FROM BILL_DETAIL bd
    CROSS APPLY (
    SELECT BILL_DETAIL.objid + ',' AS [text()]
    FROM BILL_DETAIL
    WHERE objid = bd.objid
    FOR XML PATH('')
    )bd1(ID_LIST)
    WHERE (1=1)
    GROUP BY (CASE WHEN x_billable_yn = 1 THEN 'Billable' ELSE 'Non-Billable'END + ',' + x_billable_to + ',' + COST_TYPE + ',' + x_bill_rate),
    LEFT(bd1.ID_LIST,LEN(bd1.ID_LIST)-1)
    ORDER BY (CASE WHEN x_billable_yn = 1 THEN 'Billable' ELSE 'Non-Billable'END + ',' + x_billable_to + ',' + COST_TYPE + ',' + x_bill_rate),
    LEFT(bd1.ID_LIST,LEN(bd1.ID_LIST)-1)
    )dt
    WHERE rn BETWEEN 0 AND 1
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Group by and order by clause

    Hi,
    I have wriiten the below query and i am using group by and order by clause....but i am not getting the required result
    SELECT b.ACCOUNT_REGION,CASE WHEN b.product_reference_status='Reference' THEN 'Recruited' WHEN b.product_reference_status in ('Inactive','Declined') THEN 'Inactive' WHEN b.product_reference_status ='Nominate' THEN 'Inprogress' ELSE 'Other' END product_reference_status, COUNT(decode(b.product_quarter,'Q1FY09',b.REFERENCE_ID)) Q1FY09, COUNT(decode(b.product_quarter,'Q2FY09',b.REFERENCE_ID)) Q2FY09, COUNT(decode(b.product_quarter,'Q3FY09',b.REFERENCE_ID)) Q3FY09, COUNT(decode(b.product_quarter,'Q4FY09',b.REFERENCE_ID)) Q4FY09, COUNT(decode(b.product_quarter,'Q1FY10',b.REFERENCE_ID)) Q1FY10, COUNT(decode(b.product_quarter,'Q2FY10',b.REFERENCE_ID)) Q2FY10, COUNT(decode(b.product_quarter,'Q3FY10',b.REFERENCE_ID)) Q3FY10, COUNT(decode(b.product_quarter,'Q4FY10',b.REFERENCE_ID)) Q4FY10, COUNT(b.product_quarter) Total
    FROM refdump a, ref_dh_pr b
    WHERE A.REFERENCE_ID=b.REFERENCE_ID AND (b.CREATED_ON - NVL(a.REFERENCE_DATE,a.CREATED))>15 group by b.account_region,product_reference_status order by 2
    output is as given below
    Region Status Count
    LAD     Inactive     0
    EMEA     Inactive     21
    *APAC     Inactive     2
    *APAC     Inactive     1
    EMEA     Inactive     2
    EMEA     Inprogress     220
    LAD     Inprogress     19
    LAD     Other     2
    LAD     Other     0
    LAD     Other     5
    LAD     Recruited     182
    APAC     Recruited     191
    My question is
    1) Why i am geeting two APAC regions and 3 LAD (marked *) regions when i have grouped by region and status
    2) How can i make the status in the following order
    a) Recruited
    b)Inprogress
    c)Inactive
    d)Other
    Thanks,

    <i>group by b.account_region,product_reference_status</i>
    Just take all the columns in the group by clause in your select segment and run the SQL, you'll come to know abt the different values in columns which group together.
    *009*

  • Execution order - group by and order by

    is there any execution order when we use group by and order by together in single query ?

    BOL: "Logical Processing Order of the SELECT statement
    The following steps show the logical processing order, or binding order, for a SELECT statement. This order determines when the objects defined in one step are made available to the clauses in subsequent steps. For example, if the query processor can bind to
    (access) the tables or views defined in the FROM clause, these objects and their columns are made available to all subsequent steps. Conversely, because the SELECT clause is step 8, any column aliases or derived columns defined in that clause cannot be referenced
    by preceding clauses. However, they can be referenced by subsequent clauses such as the ORDER BY clause. Note that the actual physical execution of the statement is determined by the query processor and the order may vary from this list.
    1. FROM
    2. ON
    3. JOIN
    4. WHERE
    5. GROUP BY
    6. WITH CUBE or WITH ROLLUP
    7. HAVING
    8. SELECT
    9. DISTINCT
    10. ORDER BY
    11. TOP"
    http://msdn.microsoft.com/en-us/library/ms189499.aspx
    Kalman Toth Database & OLAP Architect
    IPAD SELECT Query Video Tutorial 3.5 Hours
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • XML Publisher nested grouping, sum and order by question

    Please help in nested group by, sum and order by question
    My Data look like this:
    <Header>
    <Line1>
         <Part Number></Part Number>
              <Component>
                   <Component1></Component1>
                   <Component1 Amount></Component1 Amount>
              </Component>
              <Component>
                   <Component2></Component2>
                   <Component2 Amount></Component2 Amount>
              </Component>
    </Line1>
    <Line2>
         <Part Number></Part Number>
              <Component>
                   <Component1></Component1>
                   <Component1 Amount></Component1 Amount >
              </Component>
              <Component>
                   <Component2></Component2>
                   <Component2 Amount ></Component2 Amount >
              </Component>
    </Line2>
    </Header>
    I want to print report which is:
    1. Group by part number, component and sum the amount for a part number/component
    2. Order by part number, component
    Here is rtf file for XML publisher report
    <?for-each-group:G_LINES;PART_NUMBER?>
    <?sort:G_LINES;PART_NUMBER;'ascending';data-type='text'?>
    <?if:BREAKDOWN_COUNT>0?>
    Part Number: <?PART_NUMBER?>     Quantity: <?sum (current-group()/SHIP_QTY)?>          Part Count:<?count(current-group()/PART_NUMBER)?>     Breakdown Count:<?count(G_BREAKDOWN/COMPONENT)?>
    <?for-each:current-group()?>
    <?for-each-group:G_BREAKDOWN;COMPONENT?>
    Component: <?COMPONENT?>          Price: <?COMPONENT_PRICE?>
    <?end-for-each?>
    <?end-for-each?>
    <?end if?>
    <?end-for-each?>
    If I add <?sort:G_BREAKDOWN;COMPONENT;'ascending';data-type='text'?> inside G_BREAKDOWN grouping it gives error.
    My XML data file
    <?xml version="1.0"?>
    <!-- Generated by Oracle Reports version 6.0.8.25.0 -->
    <NI_COMMERCIAL_INVOICE_XMLP>
    <LIST_G_HEADER>
    <G_HEADER>
    <COMM_INV_NUMBER>C/901000598</COMM_INV_NUMBER>
    <COMM_INV_VERSION_NUMBER>1</COMM_INV_VERSION_NUMBER>
    <SHIP_FROM_NAME>National Instruments Europe Corp.</SHIP_FROM_NAME>
    <SHIP_FROM_ADDR>H-4031, Debrecen, Hatar ut 1/A</SHIP_FROM_ADDR>
    <SHIP_FROM_CITY></SHIP_FROM_CITY>
    <SHIP_FROM_STATE></SHIP_FROM_STATE>
    <SHIP_FROM_POSTAL_CODE></SHIP_FROM_POSTAL_CODE>
    <SHIP_FROM_COUNTRY>Hungary</SHIP_FROM_COUNTRY>
    <SHIP_TO_NAME>National Instruments Corporation (NIEC)</SHIP_TO_NAME>
    <FORMATTED_SHIP_TO_ADDR>11500 N Mopac Expwy
    Austin, TX 78759-3504
    United States</FORMATTED_SHIP_TO_ADDR>
    <SHIP_TO_ADDR1>11500 N Mopac Expwy</SHIP_TO_ADDR1>
    <SHIP_TO_ADDR2></SHIP_TO_ADDR2>
    <SHIP_TO_ADDR3></SHIP_TO_ADDR3>
    <SHIP_TO_ADDR4></SHIP_TO_ADDR4>
    <SHIP_TO_CITY>Austin</SHIP_TO_CITY>
    <SHIP_TO_STATE>TX </SHIP_TO_STATE>
    <SHIP_TO_POSTAL_CODE>78759-3504</SHIP_TO_POSTAL_CODE>
    <SHIP_TO_COUNTRY>US</SHIP_TO_COUNTRY>
    <SHIP_TO_EMAIL_ADDR></SHIP_TO_EMAIL_ADDR>
    <BILL_TO_ORG_ID>807737</BILL_TO_ORG_ID>
    <SHIPPED_VIA>UPS</SHIPPED_VIA>
    <DELIVERY_TERM>DDU</DELIVERY_TERM>
    <TEXT_FILE_SEPARATOR></TEXT_FILE_SEPARATOR>
    <DELIVERY_COUNT>4</DELIVERY_COUNT>
    <HEADER_WAYBILL></HEADER_WAYBILL>
    <LIST_G_LINES>
    <G_LINES>
    <DELIVERY_ID>2629769</DELIVERY_ID>
    <ORDER_HEADER_ID>1431282</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004434</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-387</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4565737</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>26818</INVENTORY_ITEM_ID>
    <PART_NUMBER>777459-23</PART_NUMBER>
    <PART_DESC>SCC-AI04, 2-CHANNEL ISOLATED ANALOG INPUT</PART_DESC>
    <PART_CUSTOM_DESC>SCC-AI04, Automatic Data Processing Plug-In Board</PART_CUSTOM_DESC>
    <PLANNER_CODE>SCXIH-MPS</PLANNER_CODE>
    <HTS_CODE>8471.80.9000</HTS_CODE>
    <TARIC_CODE>8471.80.0000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>158</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>4</ORIG_SHIP_QTY>
    <UNIT_PRICE>158</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>158</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>4</SHIP_QTY>
    <EXTENDED_PRICE>632</EXTENDED_PRICE>
    <UNIT_WEIGHT>.16</UNIT_WEIGHT>
    <NET_WEIGHT>.64</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/01 NIC</WAYBILL>
    <BREAKDOWN_COUNT>0</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE></BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE></BREAKDOWN_VALUE>
    <COMPONENT></COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE></COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO></COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    <G_LINES>
    <DELIVERY_ID>2629769</DELIVERY_ID>
    <ORDER_HEADER_ID>1431282</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004434</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-387</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4579950</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>143949</INVENTORY_ITEM_ID>
    <PART_NUMBER>779475-01</PART_NUMBER>
    <PART_DESC>SCC-68 I/O CONNECTOR BLOCK WITH 4 SCC SIGNAL CONDITIONING MODULE SLOTS</PART_DESC>
    <PART_CUSTOM_DESC>SCC-68, Screw Terminals</PART_CUSTOM_DESC>
    <PLANNER_CODE>DAQH-MPS</PLANNER_CODE>
    <HTS_CODE>8536.90.4000</HTS_CODE>
    <TARIC_CODE>8536.90.1000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>144</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>10</ORIG_SHIP_QTY>
    <UNIT_PRICE>144</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>144</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>10</SHIP_QTY>
    <EXTENDED_PRICE>1440</EXTENDED_PRICE>
    <UNIT_WEIGHT>1.06</UNIT_WEIGHT>
    <NET_WEIGHT>10.6</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/01 NIC</WAYBILL>
    <BREAKDOWN_COUNT>3</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>CD</COMPONENT>
    <COMPONENT_DESC>Test1</COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>50</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2803.00.0050</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE>Test1</COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY>10</COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>Paper</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>20</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2839.90.0000</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>IP</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>1370</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    <G_LINES>
    <DELIVERY_ID>2629822</DELIVERY_ID>
    <ORDER_HEADER_ID>1425429</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004365</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-372</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4579940</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>22643</INVENTORY_ITEM_ID>
    <PART_NUMBER>777687-20</PART_NUMBER>
    <PART_DESC>SCXI-1320 TEMPERATURE SENSOR TERMINAL BLOCK, CAST</PART_DESC>
    <PART_CUSTOM_DESC>SCXI-1320, Screw Terminals</PART_CUSTOM_DESC>
    <PLANNER_CODE>SCXIH-MPS</PLANNER_CODE>
    <HTS_CODE>8536.90.4000</HTS_CODE>
    <TARIC_CODE>8536.90.1000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>82</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>1</ORIG_SHIP_QTY>
    <UNIT_PRICE>82</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>82</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>1</SHIP_QTY>
    <EXTENDED_PRICE>82</EXTENDED_PRICE>
    <UNIT_WEIGHT>.57</UNIT_WEIGHT>
    <NET_WEIGHT>.57</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/02 NIC</WAYBILL>
    <BREAKDOWN_COUNT>3</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>CD</COMPONENT>
    <COMPONENT_DESC>Test1</COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>5</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2803.00.0050</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE>Test1</COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY>1</COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>Paper</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>2</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2839.90.0000</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>IP</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>75</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    <G_LINES>
    <DELIVERY_ID>2629822</DELIVERY_ID>
    <ORDER_HEADER_ID>1427673</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004391</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-377</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4579948</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>143949</INVENTORY_ITEM_ID>
    <PART_NUMBER>779475-01</PART_NUMBER>
    <PART_DESC>SCC-68 I/O CONNECTOR BLOCK WITH 4 SCC SIGNAL CONDITIONING MODULE SLOTS</PART_DESC>
    <PART_CUSTOM_DESC>SCC-68, Screw Terminals</PART_CUSTOM_DESC>
    <PLANNER_CODE>DAQH-MPS</PLANNER_CODE>
    <HTS_CODE>8536.90.4000</HTS_CODE>
    <TARIC_CODE>8536.90.1000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>144</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>13</ORIG_SHIP_QTY>
    <UNIT_PRICE>144</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>144</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>13</SHIP_QTY>
    <EXTENDED_PRICE>1872</EXTENDED_PRICE>
    <UNIT_WEIGHT>1.06</UNIT_WEIGHT>
    <NET_WEIGHT>13.78</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/02 NIC</WAYBILL>
    <BREAKDOWN_COUNT>3</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>CD</COMPONENT>
    <COMPONENT_DESC>Test1</COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>65</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2803.00.0050</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE>Test1</COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY>13</COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>Paper</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>26</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2839.90.0000</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>IP</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>1781</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    <G_LINES>
    <DELIVERY_ID>2630021</DELIVERY_ID>
    <ORDER_HEADER_ID>1429687</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004410</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-383</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4578220</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>61816</INVENTORY_ITEM_ID>
    <PART_NUMBER>777687-14</PART_NUMBER>
    <PART_DESC>SCXI-1314 FRONT MOUNTING TERMINAL BLOCK</PART_DESC>
    <PART_CUSTOM_DESC>SCXI-1314, Screw Terminals</PART_CUSTOM_DESC>
    <PLANNER_CODE>SCXIH-MPS</PLANNER_CODE>
    <HTS_CODE>8536.90.4000</HTS_CODE>
    <TARIC_CODE>8536.90.1000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>120</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>4</ORIG_SHIP_QTY>
    <UNIT_PRICE>120</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>120</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>4</SHIP_QTY>
    <EXTENDED_PRICE>480</EXTENDED_PRICE>
    <UNIT_WEIGHT>.68</UNIT_WEIGHT>
    <NET_WEIGHT>2.72</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/03 NIC</WAYBILL>
    <BREAKDOWN_COUNT>3</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>CD</COMPONENT>
    <COMPONENT_DESC>Test1</COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>20</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2803.00.0050</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE>Test1</COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY>4</COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>IP</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>452</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>Paper</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>8</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2839.90.0000</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    <G_LINES>
    <DELIVERY_ID>2630054</DELIVERY_ID>
    <ORDER_HEADER_ID>1435114</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004463</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-396</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4580160</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>96909</INVENTORY_ITEM_ID>
    <PART_NUMBER>778729-01</PART_NUMBER>
    <PART_DESC>NI PCI-4474, 4 INPUTS, 24-BIT DYNAMIC SIGNAL ACQUISITION</PART_DESC>
    <PART_CUSTOM_DESC>PCI-4474, Automatic Data Processing Plug-In Board</PART_CUSTOM_DESC>
    <PLANNER_CODE>INSTRHMPS</PLANNER_CODE>
    <HTS_CODE>8471.80.4000</HTS_CODE>
    <TARIC_CODE>8471.80.0000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>960</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>4</ORIG_SHIP_QTY>
    <UNIT_PRICE>960</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>960</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>4</SHIP_QTY>
    <EXTENDED_PRICE>3840</EXTENDED_PRICE>
    <UNIT_WEIGHT>.68</UNIT_WEIGHT>
    <NET_WEIGHT>2.72</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/04 NIC</WAYBILL>
    <BREAKDOWN_COUNT>0</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE></BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE></BREAKDOWN_VALUE>
    <COMPONENT></COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE></COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO></COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    </LIST_G_LINES>
    </G_HEADER>
    </LIST_G_HEADER>
    </NI_COMMERCIAL_INVOICE_XMLP>
    I want my report for part number (which has multiple component) look like:
    Part Number: 779475-01     Quantity: 23          Part Count:2     Breakdown Count:6
    Component: CD          Amount: 115
    Component: IP          Amount: 3151
    Component: Paper          Amount: 46
    Any help or suggestion is appreciated
    RK Shah
    [email protected]

    I am using the latest 10.1.3.2.1 build 87.
    The output that I see is :
    Part Number: 777687-14 Quantity: 4 Part Count:1 Breakdown Count:3
    Component: CD
    Count: 4
    Sum of Component Price: 20
    Component: IP
    Count: 0
    Sum of Component Price: 452
    Component: Paper
    Count: 0
    Sum of Component Price: 8
    Part Number: 777687-20 Quantity: 1 Part Count:1 Breakdown Count:3
    Component: CD
    Count: 1
    Sum of Component Price: 5
    Component: Paper
    Count: 0
    Sum of Component Price: 2
    Component: IP
    Count: 0
    Sum of Component Price: 75
    Part Number: 779475-01 Quantity: 23 Part Count:2 Breakdown Count:3
    Component: CD
    Count: 23
    Sum of Component Price: 115
    Component: Paper
    Count: 0
    Sum of Component Price: 46
    Component: IP
    Count: 0
    Sum of Component Price: 3151
    and the XML data that I used is :
    <?xml version="1.0"?>
    <!-- Generated by Oracle Reports version 6.0.8.25.0 -->
    <NI_COMMERCIAL_INVOICE_XMLP>
    <LIST_G_HEADER>
    <G_HEADER>
    <COMM_INV_NUMBER>C/901000598</COMM_INV_NUMBER>
    <COMM_INV_VERSION_NUMBER>1</COMM_INV_VERSION_NUMBER>
    <SHIP_FROM_NAME>National Instruments Europe Corp.</SHIP_FROM_NAME>
    <SHIP_FROM_ADDR>H-4031, Debrecen, Hatar ut 1/A</SHIP_FROM_ADDR>
    <SHIP_FROM_CITY></SHIP_FROM_CITY>
    <SHIP_FROM_STATE></SHIP_FROM_STATE>
    <SHIP_FROM_POSTAL_CODE></SHIP_FROM_POSTAL_CODE>
    <SHIP_FROM_COUNTRY>Hungary</SHIP_FROM_COUNTRY>
    <SHIP_TO_NAME>National Instruments Corporation (NIEC)</SHIP_TO_NAME>
    <FORMATTED_SHIP_TO_ADDR>11500 N Mopac Expwy
    Austin, TX 78759-3504
    United States</FORMATTED_SHIP_TO_ADDR>
    <SHIP_TO_ADDR1>11500 N Mopac Expwy</SHIP_TO_ADDR1>
    <SHIP_TO_ADDR2></SHIP_TO_ADDR2>
    <SHIP_TO_ADDR3></SHIP_TO_ADDR3>
    <SHIP_TO_ADDR4></SHIP_TO_ADDR4>
    <SHIP_TO_CITY>Austin</SHIP_TO_CITY>
    <SHIP_TO_STATE>TX </SHIP_TO_STATE>
    <SHIP_TO_POSTAL_CODE>78759-3504</SHIP_TO_POSTAL_CODE>
    <SHIP_TO_COUNTRY>US</SHIP_TO_COUNTRY>
    <SHIP_TO_EMAIL_ADDR></SHIP_TO_EMAIL_ADDR>
    <BILL_TO_ORG_ID>807737</BILL_TO_ORG_ID>
    <SHIPPED_VIA>UPS</SHIPPED_VIA>
    <DELIVERY_TERM>DDU</DELIVERY_TERM>
    <TEXT_FILE_SEPARATOR></TEXT_FILE_SEPARATOR>
    <DELIVERY_COUNT>4</DELIVERY_COUNT>
    <HEADER_WAYBILL></HEADER_WAYBILL>
    <LIST_G_LINES>
    <G_LINES>
    <DELIVERY_ID>2629769</DELIVERY_ID>
    <ORDER_HEADER_ID>1431282</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004434</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-387</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4565737</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>26818</INVENTORY_ITEM_ID>
    <PART_NUMBER>777459-23</PART_NUMBER>
    <PART_DESC>SCC-AI04, 2-CHANNEL ISOLATED ANALOG INPUT</PART_DESC>
    <PART_CUSTOM_DESC>SCC-AI04, Automatic Data Processing Plug-In Board</PART_CUSTOM_DESC>
    <PLANNER_CODE>SCXIH-MPS</PLANNER_CODE>
    <HTS_CODE>8471.80.9000</HTS_CODE>
    <TARIC_CODE>8471.80.0000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>158</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>4</ORIG_SHIP_QTY>
    <UNIT_PRICE>158</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>158</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>4</SHIP_QTY>
    <EXTENDED_PRICE>632</EXTENDED_PRICE>
    <UNIT_WEIGHT>.16</UNIT_WEIGHT>
    <NET_WEIGHT>.64</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/01 NIC</WAYBILL>
    <BREAKDOWN_COUNT>0</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE></BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE></BREAKDOWN_VALUE>
    <COMPONENT></COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE></COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO></COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    <G_LINES>
    <DELIVERY_ID>2629769</DELIVERY_ID>
    <ORDER_HEADER_ID>1431282</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004434</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-387</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4579950</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>143949</INVENTORY_ITEM_ID>
    <PART_NUMBER>779475-01</PART_NUMBER>
    <PART_DESC>SCC-68 I/O CONNECTOR BLOCK WITH 4 SCC SIGNAL CONDITIONING MODULE SLOTS</PART_DESC>
    <PART_CUSTOM_DESC>SCC-68, Screw Terminals</PART_CUSTOM_DESC>
    <PLANNER_CODE>DAQH-MPS</PLANNER_CODE>
    <HTS_CODE>8536.90.4000</HTS_CODE>
    <TARIC_CODE>8536.90.1000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>144</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>10</ORIG_SHIP_QTY>
    <UNIT_PRICE>144</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>144</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>10</SHIP_QTY>
    <EXTENDED_PRICE>1440</EXTENDED_PRICE>
    <UNIT_WEIGHT>1.06</UNIT_WEIGHT>
    <NET_WEIGHT>10.6</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/01 NIC</WAYBILL>
    <BREAKDOWN_COUNT>3</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>CD</COMPONENT>
    <COMPONENT_DESC>Test1</COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>50</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2803.00.0050</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE>Test1</COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY>10</COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>Paper</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>20</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2839.90.0000</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>IP</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>1370</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    <G_LINES>
    <DELIVERY_ID>2629822</DELIVERY_ID>
    <ORDER_HEADER_ID>1425429</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004365</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-372</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4579940</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>22643</INVENTORY_ITEM_ID>
    <PART_NUMBER>777687-20</PART_NUMBER>
    <PART_DESC>SCXI-1320 TEMPERATURE SENSOR TERMINAL BLOCK, CAST</PART_DESC>
    <PART_CUSTOM_DESC>SCXI-1320, Screw Terminals</PART_CUSTOM_DESC>
    <PLANNER_CODE>SCXIH-MPS</PLANNER_CODE>
    <HTS_CODE>8536.90.4000</HTS_CODE>
    <TARIC_CODE>8536.90.1000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>82</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>1</ORIG_SHIP_QTY>
    <UNIT_PRICE>82</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>82</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>1</SHIP_QTY>
    <EXTENDED_PRICE>82</EXTENDED_PRICE>
    <UNIT_WEIGHT>.57</UNIT_WEIGHT>
    <NET_WEIGHT>.57</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/02 NIC</WAYBILL>
    <BREAKDOWN_COUNT>3</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>CD</COMPONENT>
    <COMPONENT_DESC>Test1</COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>5</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2803.00.0050</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE>Test1</COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY>1</COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>Paper</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>2</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2839.90.0000</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>IP</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>75</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    <G_LINES>
    <DELIVERY_ID>2629822</DELIVERY_ID>
    <ORDER_HEADER_ID>1427673</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004391</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-377</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4579948</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>143949</INVENTORY_ITEM_ID>
    <PART_NUMBER>779475-01</PART_NUMBER>
    <PART_DESC>SCC-68 I/O CONNECTOR BLOCK WITH 4 SCC SIGNAL CONDITIONING MODULE SLOTS</PART_DESC>
    <PART_CUSTOM_DESC>SCC-68, Screw Terminals</PART_CUSTOM_DESC>
    <PLANNER_CODE>DAQH-MPS</PLANNER_CODE>
    <HTS_CODE>8536.90.4000</HTS_CODE>
    <TARIC_CODE>8536.90.1000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>144</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>13</ORIG_SHIP_QTY>
    <UNIT_PRICE>144</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>144</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>13</SHIP_QTY>
    <EXTENDED_PRICE>1872</EXTENDED_PRICE>
    <UNIT_WEIGHT>1.06</UNIT_WEIGHT>
    <NET_WEIGHT>13.78</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/02 NIC</WAYBILL>
    <BREAKDOWN_COUNT>3</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>CD</COMPONENT>
    <COMPONENT_DESC>Test1</COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>65</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2803.00.0050</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE>Test1</COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY>13</COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>Paper</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>26</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2839.90.0000</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>IP</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>1781</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    <G_LINES>
    <DELIVERY_ID>2630021</DELIVERY_ID>
    <ORDER_HEADER_ID>1429687</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004410</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-383</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4578220</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>61816</INVENTORY_ITEM_ID>
    <PART_NUMBER>777687-14</PART_NUMBER>
    <PART_DESC>SCXI-1314 FRONT MOUNTING TERMINAL BLOCK</PART_DESC>
    <PART_CUSTOM_DESC>SCXI-1314, Screw Terminals</PART_CUSTOM_DESC>
    <PLANNER_CODE>SCXIH-MPS</PLANNER_CODE>
    <HTS_CODE>8536.90.4000</HTS_CODE>
    <TARIC_CODE>8536.90.1000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>120</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>4</ORIG_SHIP_QTY>
    <UNIT_PRICE>120</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>120</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>4</SHIP_QTY>
    <EXTENDED_PRICE>480</EXTENDED_PRICE>
    <UNIT_WEIGHT>.68</UNIT_WEIGHT>
    <NET_WEIGHT>2.72</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/03 NIC</WAYBILL>
    <BREAKDOWN_COUNT>3</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>CD</COMPONENT>
    <COMPONENT_DESC>Test1</COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>20</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2803.00.0050</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE>Test1</COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY>4</COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>IP</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>452</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>Paper</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>8</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2839.90.0000</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    <G_LINES>
    <DELIVERY_ID>2630054</DELIVERY_ID>
    <ORDER_HEADER_ID>1435114</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004463</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-396</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4580160</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>96909</INVENTORY_ITEM_ID>
    <PART_NUMBER>778729-01</PART_NUMBER>
    <PART_DESC>NI PCI-4474, 4 INPUTS, 24-BIT DYNAMIC SIGNAL ACQUISITION</PART_DESC>
    <PART_CUSTOM_DESC>PCI-4474, Automatic Data Processing Plug-In Board</PART_CUSTOM_DESC>
    <PLANNER_CODE>INSTRHMPS</PLANNER_CODE>
    <HTS_CODE>8471.80.4000</HTS_CODE>
    <TARIC_CODE>8471.80.0000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>960</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>4</ORIG_SHIP_QTY>
    <UNIT_PRICE>960</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>960</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>4</SHIP_QTY>
    <EXTENDED_PRICE>3840</EXTENDED_PRICE>
    <UNIT_WEIGHT>.68</UNIT_WEIGHT>
    <NET_WEIGHT>2.72</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/04 NIC</WAYBILL>
    <BREAKDOWN_COUNT>0</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE></BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE></BREAKDOWN_VALUE>
    <COMPONENT></COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE></COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO></COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    </LIST_G_LINES>
    </G_HEADER>
    </LIST_G_HEADER>
    </NI_COMMERCIAL_INVOICE_XMLP>

  • 3 Table Join with group by and order by clauses

    I am porting from MySQL to Oracle 8i. I have a three Table Join in MySQL as follows:
    select distinct TO_DAYS(l.listend)-TO_DAYS(NOW()) AS daysLeft, i.minbid, l.listend, i.itemid, i.itemtitle, l.listingid, l.lendstart, l.lendend, l.status, MAX(b.amount) AS curBid, COUNT(b.amount) AS numBids from TBL_ITEMS i, TBL_LISTING l LEFT JOIN TBL_BIDS b ON l.listingid=b.listingid where i.itemid = l.itemid AND l.status='1' AND (TO_DAYS(l.listend)-TO_DAYS(NOW()) >= 0) AND i.catcode LIKE'12__' GROUP BY listingid order by curBid DESC, daysLeft;
    It performs an straight join on the first 2 tables (TBL_ITEMS and TBL_LISTING) and a LEFT JOIN between the previous result set and TBL_BIDS. TBL_BIDS uses a group by clause to obtain MAX and COUNT info. This final result set is the sorted (ORDER BY).
    I have tried to reconstruct this type of call in Oracle and have failed. Several problems that I have notices: Oracle does not let me pull in additional columns when doing a GROUP BY clause.
    (see below for my work around)
    I have worked around the problem by creating a TABLE with the group by functionality and doing a straing 3 table join. (NOTE: I cannot create a view because use a LIKE function in the call... view dont have indexes). However, when I try to alias the column that returns DATE subtraction ("l.listend-TRUNC(SYSDATE) daysLeft" OR "l.listend-TRUNC(SYSDATE) dayLeft") I cannot use the LIKE statement.
    Here is my question. How do I port the above 3-table MySQL call to Oracle. Why am I having these problems (is it the Oracle optimizer?) and how do I avaopid them in the future.
    I really appreciate anyone's input. Thanks,
    Inder
    WORK AROUND:
    FIRST STEP:
    "create TABLE BIDSUM as
    select l.listingid, COUNT(b.amount) numBids, MAX(b.amount) curBid from TBL_LISTING l, TBL_BIDS b where l.listingid=b.listingid(+) group by (l.listingid);"
    NEXT STEP:
    select i.minbid, i.itemtitle, l.lendstart-TRUNC(SYSDATE), l.lendend, l.listingid, l.status, s.numbids, s.curbid from TBL_ITEMS i, TBL_LISTING l, BIDSUM s where l.listingid=s.listingid AND i.itemid=l.itemid AND l.status='1' AND i.catcode LIKE '12%';
    THIS ALSO WORKS (no LIKE):
    "select i.minbid, i.itemtitle, l.lendstart-TRUNC(SYSDATE) daysLeft, l.lendend, l.listingid, l.status, s.numbids, s.curbid from TBL_ITEMS i, TBL_LISTING l, BIDSUM s where l.listingid=s.listingid AND i.itemid=l.itemid AND l.status='1' AND i.catcode='12'";
    BUT THIS DOES NOT (alias the DATE arimetic)
    select i.minbid, i.itemtitle, l.lendstart-TRUNC(SYSDATE) daysLeft, l.lendend, l.listingid, l.status, s.numbids, s.curbid from TBL_ITEMS i, TBL_LISTING l, BIDSUM s where l.listingid=s.listingid AND i.itemid=l.itemid AND l.status='1' AND i.catcode LIKE '12__';

    I am porting from MySQL to Oracle 8i. I have a three Table Join in MySQL as follows:
    select distinct TO_DAYS(l.listend)-TO_DAYS(NOW()) AS daysLeft, i.minbid, l.listend, i.itemid, i.itemtitle, l.listingid, l.lendstart, l.lendend, l.status, MAX(b.amount) AS curBid, COUNT(b.amount) AS numBids from TBL_ITEMS i, TBL_LISTING l LEFT JOIN TBL_BIDS b ON l.listingid=b.listingid where i.itemid = l.itemid AND l.status='1' AND (TO_DAYS(l.listend)-TO_DAYS(NOW()) >= 0) AND i.catcode LIKE'12__' GROUP BY listingid order by curBid DESC, daysLeft;
    It performs an straight join on the first 2 tables (TBL_ITEMS and TBL_LISTING) and a LEFT JOIN between the previous result set and TBL_BIDS. TBL_BIDS uses a group by clause to obtain MAX and COUNT info. This final result set is the sorted (ORDER BY).
    I have tried to reconstruct this type of call in Oracle and have failed. Several problems that I have notices: Oracle does not let me pull in additional columns when doing a GROUP BY clause.
    (see below for my work around)
    I have worked around the problem by creating a TABLE with the group by functionality and doing a straing 3 table join. (NOTE: I cannot create a view because use a LIKE function in the call... view dont have indexes). However, when I try to alias the column that returns DATE subtraction ("l.listend-TRUNC(SYSDATE) daysLeft" OR "l.listend-TRUNC(SYSDATE) dayLeft") I cannot use the LIKE statement.
    Here is my question. How do I port the above 3-table MySQL call to Oracle. Why am I having these problems (is it the Oracle optimizer?) and how do I avaopid them in the future.
    I really appreciate anyone's input. Thanks,
    Inder
    WORK AROUND:
    FIRST STEP:
    "create TABLE BIDSUM as
    select l.listingid, COUNT(b.amount) numBids, MAX(b.amount) curBid from TBL_LISTING l, TBL_BIDS b where l.listingid=b.listingid(+) group by (l.listingid);"
    NEXT STEP:
    select i.minbid, i.itemtitle, l.lendstart-TRUNC(SYSDATE), l.lendend, l.listingid, l.status, s.numbids, s.curbid from TBL_ITEMS i, TBL_LISTING l, BIDSUM s where l.listingid=s.listingid AND i.itemid=l.itemid AND l.status='1' AND i.catcode LIKE '12%';
    THIS ALSO WORKS (no LIKE):
    "select i.minbid, i.itemtitle, l.lendstart-TRUNC(SYSDATE) daysLeft, l.lendend, l.listingid, l.status, s.numbids, s.curbid from TBL_ITEMS i, TBL_LISTING l, BIDSUM s where l.listingid=s.listingid AND i.itemid=l.itemid AND l.status='1' AND i.catcode='12'";
    BUT THIS DOES NOT (alias the DATE arimetic)
    select i.minbid, i.itemtitle, l.lendstart-TRUNC(SYSDATE) daysLeft, l.lendend, l.listingid, l.status, s.numbids, s.curbid from TBL_ITEMS i, TBL_LISTING l, BIDSUM s where l.listingid=s.listingid AND i.itemid=l.itemid AND l.status='1' AND i.catcode LIKE '12__';

  • Date_format, group by and order by together

    Hi,
    SELECT
                             T.foreign_network_id as "Network ID",
                             date_format(T.ARRIVAL_DATE,'%v-%x') as "Date",
                        sum(case when((networks_rejected = 0)
                                       and (T.sor_reapply = 'N')
                                       and (T.sor_reason in ('NP', 'NU', 'NT', 'HT')))
                                       then T.CNT else 0 end) as "Before Steering",
                   sum(case when(sor_reason in ('NP', 'HT', 'T2', 'TM', 'NM', 'MM', 'IPMM', 'NPMM'))
                                  then T.CNT else 0 end) as "After Steering"
              FROM     ST_INC T,
                        NETWORKS N,
                        ZONE_NW_MAP ZN,
                        ZONES Z,
                        PAYMENT_TYPE PT
              WHERE      T.FOREIGN_NETWORK_ID = N.NETWORK_ID
              AND      ZN.NETWORK_ID = N.NETWORK_ID
              AND      Z.ZONE_ID = ZN.ZONE_ID
              AND      PT.id = T.ptype
              AND opcode = 2
              AND      sor_action is not null
                             and Z.ZONE_ID = 269
                   group by
                             date_format(T.ARRIVAL_DATE,'%v-%x'),
    T.foreign_network_id
    order by date_format(T.ARRIVAL_DATE,'%v-%x')
    Above code works but it orders malfunctionally. It orders as if the week-day combination is a string not a date.
    I want:
    09.2009
    10.2009
    02.2010
    03.2010
    06.2011
    It outputs:
    02.2010
    03.2010
    06.2011
    09.2009
    10.2009
    I know that the problem arises from the "order by" part. When I call the function date_format I guess a different data type is returnd thus the result is not achieved as intended. So I thought of changing that part only making last line order by T.ARRIVAL_DATE. It worked fine in mysql however it gave error in oracle. This is the error:
    ORA-00979: not a GROUP BY expression
    00979. 00000 - "not a GROUP BY expression"
    When I replace all "date_format(T.ARRIVAL_DATE,'%v-%x')" s with "T.ARRIVAL_DATE" it works fine again. However this is not what i wanted. I want to see the results in the format I gave and group with respect to that fomat, additionally ordering them chronologically. How is that possible?

    Frank Kulash wrote:
    Hi,
    baydinfb wrote:
    Hi,
    SELECT
                             T.foreign_network_id as "Network ID",
                             date_format(T.ARRIVAL_DATE,'%v-%x') as "Date",
                        sum(case when((networks_rejected = 0)
                                       and (T.sor_reapply = 'N')
                                       and (T.sor_reason in ('NP', 'NU', 'NT', 'HT')))
                                       then T.CNT else 0 end) as "Before Steering",
                   sum(case when(sor_reason in ('NP', 'HT', 'T2', 'TM', 'NM', 'MM', 'IPMM', 'NPMM'))
                                  then T.CNT else 0 end) as "After Steering"
              FROM     ST_INC T,
                        NETWORKS N,
                        ZONE_NW_MAP ZN,
                        ZONES Z,
                        PAYMENT_TYPE PT
              WHERE      T.FOREIGN_NETWORK_ID = N.NETWORK_ID
              AND      ZN.NETWORK_ID = N.NETWORK_ID
              AND      Z.ZONE_ID = ZN.ZONE_ID
              AND      PT.id = T.ptype
              AND opcode = 2
              AND      sor_action is not null
                             and Z.ZONE_ID = 269
                   group by
                             date_format(T.ARRIVAL_DATE,'%v-%x'),
    T.foreign_network_id
    order by date_format(T.ARRIVAL_DATE,'%v-%x')
    Above code works but it orders malfunctionally. It orders as if the week-day combination is a string not a date. Apparantly, date_format returns a string, similar to how TO_CHAR in Oracle returns a string. To verify this, create a view where one on the columns is the results of date_format, and then describe that view.
    I want:
    09.2009
    10.2009
    02.2010
    03.2010
    06.2011
    It outputs:
    02.2010
    03.2010
    06.2011
    09.2009
    10.2009
    I know that the problem arises from the "order by" part. When I call the function date_format I guess a different data type is returnd thus the result is not achieved as intended. So I thought of changing that part only making last line order by T.ARRIVAL_DATE. It worked fine in mysql however it gave error in oracle. This is the error:
    ORA-00979: not a GROUP BY expression
    00979. 00000 - "not a GROUP BY expression"
    When I replace all "date_format(T.ARRIVAL_DATE,'%v-%x')" s with "T.ARRIVAL_DATE" it works fine again. However this is not what i wanted. I want to see the results in the format I gave and group with respect to that fomat, additionally ordering them chronologically. How is that possible?I don't know about yur database, but in Oracle you can "GROUP BY t.arrival_date", and still use expressions like "TO_CHAR (t.arrival_date, ...)" in the SELECT clause. Then, if you say "ORDER BY t.arrival_date" it will sort by the arrival_date column in the table, even if the alias "arrival_date" is used for something else.
    Using scott.emp to illustrate:
    SELECT       TO_CHAR (e.hiredate, 'fmMonth YYYY')     AS hiredate
    ,       e.hiredate                    AS raw_date
    FROM       scott.emp     e
    GROUP BY  e.hiredate
    ORDER BY  hiredate          -- This means the result set column called "HIREDATE"
    ,       e.hiredate          -- This means the table column called "HIREDATE"
    ;Output:
    HIREDATE                                  RAW_DATE
    April 1981                                02-Apr-1981 00:00:00
    April 1987                                19-Apr-1987 00:00:00
    December 1980                             17-Dec-1980 00:00:00
    December 1981                             03-Dec-1981 00:00:00
    February 1981                             20-Feb-1981 00:00:00
    February 1981                             22-Feb-1981 00:00:00
    January 1982                              23-Jan-1982 00:00:00
    June 1981                                 09-Jun-1981 00:00:00
    May 1981                                  01-May-1981 00:00:00
    May 1987                                  23-May-1987 00:00:00
    November 1981                             17-Nov-1981 00:00:00
    September 1981                            08-Sep-1981 00:00:00
    September 1981                            28-Sep-1981 00:00:00Notice how, within a month (e.g. February 1981) the rows are sorted by DATE.Thanks for the answers, I tried, no errors but there is a problem with the requirements. Correct me if I am wrong.
    I can use the expression with "date_format" or "to_char" in select clause and then group by the actual date field. But this does not include all I want. When I formatted a date column as "week-year" such as 09.2010 I also meant to group by according to that format. In your solution totally same dates are grouped together but I want to be able to have that same weeks(no need to have same days) are grouped or even same months are grouped by and then order by actual date.
    Edited by: baydinfb on Aug 27, 2010 2:13 PM

  • GROUP BY and ORDER BY help needed

    I have got an sql query where I have the need to pull out the latest copy of duplicate info, but what is happening is that the first instance is being displayed. The query I have is this:
    SELECT *
    FROM tbl_maincontenttext
    WHERE fld_menusection = 3
    GROUP BY fld_webpage
    ORDER BY fld_timedate DESC
    Basically, I have content that is listed under menu section 3, but within that I will have several copies of content that will relate to a specific webpage (eg: about us). What is currently happening is that GROUP BY is obviously grouping the similarly named 'about us', but it is pulling the first record it comes across out of the database rather than the latest updated record.
    As you can see, I am trying to get the query to order by fld_timedate which is a CURRENT_TIMESTAMP, but it's not working!
    I'm hoping that there is some sort of SQL that I am unaware of that will help me group by and display the latest update/content.
    Thanks.
    Mat

    It would help if you could show us the table definition. Your SQL statement is ambigous because you are selecting all table columns, yet only including one column in the group by clause.  A SQL statement must contain all selected columns that are not aggregates. Most DBMS will return an error for this statement. Others that don't return an error will return unexpected results.

  • In Oracle SQL, cannot use column in select statement and order by

    Hi,
    Is there a work around for this.
    Thanks in advance
    Pablo.

    Hi,
    943981 wrote:
    Hi All,
    This is the error I get:
    ORA-00960: ambiguous column naming in select list
    00960. 00000 - "ambiguous column naming in select list"
    *Cause:    A column name in the order-by list matches more than one select
    list columns.
    *Action:   Remove duplicate column naming in select list.
    Error at Line: 6 Column: 17That error message looks pretty clear to me. What don't you understand?
    Either
    (a) use aliases, so each column has a unique name, or
    (b) remove duplicate columns from the SELECT clause.
    Post your query. It's hard to say exactly what you're doing wrong when we don't know exactly what you're doing.
    For best results, post a complete test script (including CREATE TABLE and INSERT statements, if necessary) that people can to re-create the problem and test their ideas.
    See the forum FAQ {message:id=9360002}

  • Group by and Order by...

    Hi Guys,
    I need to get a value in a specific order in a select statment.
    I have the following table...
    with t as(
    SELECT 1 ID, 'aaa' VAL FROM dual UNION ALL
    SELECT 2 ID, 'aaa' VAL FROM dual UNION ALL
    SELECT 3 ID, 'bbb' VAL FROM dual UNION ALL
    SELECT 4 ID, 'bbb' VAL FROM dual UNION ALL
    SELECT 5 ID, 'ccc' VAL FROM dual )
    SELECT DISTINCT val
    FROM   t
    ORDER BY t.id;This genarates an error 'Not a SELECTed operation'.
    The out put I am expecting is...
    aaa
    bbb
    ccc
    (Distinct Val values with Order by ID)
    Is this possible?
    Thanks...

    The problem is that the distinct implicitly groups the data. And when it has grouped the data, there is no ID column available anymore.
    SQL> with t as(
      2  SELECT 1 ID, 'aaa' VAL FROM dual UNION ALL
      3  SELECT 2 ID, 'aaa' VAL FROM dual UNION ALL
      4  SELECT 3 ID, 'bbb' VAL FROM dual UNION ALL
      5  SELECT 4 ID, 'bbb' VAL FROM dual UNION ALL
      6  SELECT 5 ID, 'ccc' VAL FROM dual )
      7  SELECT DISTINCT val
      8  FROM   t
      9  ORDER BY t.id
    10  /
    ORDER BY t.id
    ERROR at line 9:
    ORA-01791: not a SELECTed expressionYou write that you want your output to be:
    aaa
    bbb
    ccc
    but how do you want your output to be when this is your source data?
    SQL> with t as(
      2  SELECT 1 ID, 'aaa' VAL FROM dual UNION ALL
      3  SELECT 2 ID, 'bbb' VAL FROM dual UNION ALL
      4  SELECT 3 ID, 'bbb' VAL FROM dual UNION ALL
      5  SELECT 4 ID, 'aaa' VAL FROM dual UNION ALL
      6  SELECT 5 ID, 'ccc' VAL FROM dual )
      7  SELECT DISTINCT val
      8  FROM   t
      9  ORDER BY t.id
    10  /
    ORDER BY t.id
    ERROR at line 9:
    ORA-01791: not a SELECTed expressionThere is now also a 'aaa' value at ID 4, after 'bbb' at ID's 2 and 3. You didn't tell and that's why Oracle can't execute your query.
    If you convert your query to use a group by operation, then you can explicitly tell on which aggregated expression you want your results to be ordered:
    SQL> with t as(
      2  SELECT 1 ID, 'aaa' VAL FROM dual UNION ALL
      3  SELECT 2 ID, 'aaa' VAL FROM dual UNION ALL
      4  SELECT 3 ID, 'bbb' VAL FROM dual UNION ALL
      5  SELECT 4 ID, 'bbb' VAL FROM dual UNION ALL
      6  SELECT 5 ID, 'ccc' VAL FROM dual )
      7  select val
      8    from t
      9   group by val
    10   order by min(id)
    11  /
    VAL
    aaa
    bbb
    ccc
    3 rows selected.Hope this helps.
    Regards,
    Rob.

  • How to write a query with group by and order by for a date column

    I have a query:
    select count(*), to_char(s.pdate,'Mon-yyyy') as month from sTable s
    group by to_char(s.pdate,'Mon-yyyy')
    order by to_date(s.pdate,'Mon-yyyy')
    However, I got an error: not a GROUP By expression.
    If i just run: select count(*), to_char(s.pdate,'Mon-yyyy') as month from sTable s
    group by to_char(s.pdate,'Mon-yyyy')
    it is work fine.
    How to solve the problem.
    Thanks,
    Jen

    Jen,
    You can use this code
    with sTable as (select to_date('01/01/2009', 'dd/mm/yyyy') pdate,  1 code from dual union all
                  select to_date('02/02/2009', 'dd/mm/yyyy') a, 2 code from dual union all
                  select to_date('01/03/2009', 'dd/mm/yyyy') d, 3 code from dual union all
                  select to_date('05/04/2009', 'dd/mm/yyyy') g, 4 code from dual union all
                  select to_date('05/05/2009', 'dd/mm/yyyy') g, 4 code from dual union all
                  select to_date('05/06/2009', 'dd/mm/yyyy') g, 4 code from dual union all
                  select to_date('05/07/2009', 'dd/mm/yyyy') g, 4 code from dual union all
                  select to_date('05/08/2009', 'dd/mm/yyyy') g, 4 code from dual union all
                  select to_date('05/09/2009', 'dd/mm/yyyy') g, 4 code from dual union all
                  select to_date('05/10/2009', 'dd/mm/yyyy') g, 4 code from dual union all
                  select to_date('05/11/2009', 'dd/mm/yyyy') g, 4 code from dual union all
                  select to_date('05/12/2009', 'dd/mm/yyyy') h, 5 code from dual)
    select cnt, to_char(to_date(mnt||'01', 'yyyymmdd'), 'Mon-yyyy')
      from (select count(*) cnt, to_char(s.pdate,'yyyymm') as mnt
              from sTable s
             group by to_char(s.pdate,'yyyymm')
             order by to_char(s.pdate,'yyyymm')
           CNT MONTH
             1 Jan-2009
             1 Feb-2009
             1 Mar-2009
             1 Apr-2009
             1 May-2009
             1 Jun-2009
             1 Jul-2009
             1 Aug-2009
             1 Sep-2009
             1 Oct-2009
             1 Nov-2009
             1 Dec-2009
    12 rows selectedyour problem was that you are using a expresión in the order by (to_date...) that is distinct to the query results (to_char...).
    Regards,
    Mike

  • In FF 7.0.1, the New Tab button on the Tab Strip disappeared after clicking the Tab Group icon and trying to return, so I'm looking for advice on how to get the New Tab to reappear on the Tab Strip.

    In Windows Vista, FF 7.0.1, I selected the Tab Group button to try it out. However, when I selected the Tab Group button again to close that view, the New Tab button in the Tab Strip no longer appears. I'm requesting help to restore the New Tab button (has the "+" sign on it) on the Tab Strip just to the right of the currently open tabs.

    You can find the New Tab button showing as a '+' on the Tab bar.
    You can open the Customize window and drag the New Tab button that shows as a plus sign (+) from the Tab bar on another toolbar and it will become a regular toolbar button like the New Tab button that you have in Firefox 3 versions.<br />
    Open the Customize window via "View > Toolbars > Customize" or via "Firefox > Options > Toolbar Layout"
    If you can't find the New Tab button then click the "Restore Default Set" button in the Customize window.
    If you want the New Tab button at the far right end of the Tab bar then place a flexible space to the left of it.

  • Group by and then convert form Row to column

    Hi All,
    below is a transaction table for bank customer.
    region_id     cutomer_id     transaction_type     transaction_date
    101          12345          CC               10-March-2011
    101          12345          DC               07-March-2011
    101          12345          P1               01-March-2011
    101          12345          p2               10-Jan-2011
    102          45678          CC               15-feb-2011
    101          12345          p3               27-OCT-2010with combinaton of region_id and customer_id, we get uniq record from the table. There are also different kind of transaction a customer has done. It is given in transaction_type column (CC - Credit card, Dc - Debit Card, and those start with P% {including P1, p2, p3} = payment).
    Now my requirement is to get the number of transaction for each transaction type for a current year and also number of total transaction by the customer. Below is my output table.
    region_id     cutomer_id     transaction_type     transaction_date     Tran_type_cc     Tran_type_DC     Tran_type_P     count_tran
    101          12345          CC               10-March-2011          1          1          2          5
    101          12345          DC               07-March-2011          1          1          2          5
    101          12345          P1               01-March-2011          1          1          2          5
    101          12345          p2               10-Jan-2011          1          1          2          5
    102          45678          CC               15-feb-2011          1          0          0          1
    101          12345          p3               27-OCT-2010          1          1          2          5if i do group by it gives me result but at row level and to convert row into column to get above result, i need to use decode function. My sourcec is containing 25 miliion records, and if i execute the query, it is getting hanged. Can someone help me how can i write a fine tuned query by using analytical function

    How about this?
    Note: I suppose, p1, P1, p2, P2, p3, P3 all belong to the same payment category regardless of their upper/lower case.
    Here is the table and the data:
    CREATE TABLE T1 (REGION_ID NUMBER, CUSTOMER_ID NUMBER, TRAN_TYPE VARCHAR2(5), TRAN_DATE DATE);
    INSERT INTO T1 VALUES (101, 12345, 'CC', TO_DATE('10-Mar-2011','DD-MON-YYYY'));
    INSERT INTO T1 VALUES (101, 12345, 'DC', TO_DATE('07-Mar-2011','DD-MON-YYYY'));
    INSERT INTO T1 VALUES (101, 12345, 'P1', TO_DATE('01-Mar-2011','DD-MON-YYYY'));
    INSERT INTO T1 VALUES (101, 12345, 'p2', TO_DATE('10-Jan-2011','DD-MON-YYYY'));
    INSERT INTO T1 VALUES (102, 45678, 'CC', TO_DATE('15-FEB-2011','DD-MON-YYYY'));
    INSERT INTO T1 VALUES (101, 12345, 'p3', TO_DATE('27-OCT-2010','DD-MON-YYYY'));Here is the query:
    SELECT REGION_ID, CUSTOMER_ID, TRAN_TYPE, TRAN_DATE
      , SUM(DECODE(TRAN_TYPE, 'CC', '1','0')) OVER (PARTITION BY CUSTOMER_ID) AS CC
      , SUM(DECODE(TRAN_TYPE, 'DC', '1', '0')) OVER (PARTITION BY CUSTOMER_ID ) AS DC
      , SUM(DECODE(SUBSTR(UPPER(TRAN_TYPE), 1,1) , 'P', '1','0')) OVER (PARTITION BY CUSTOMER_ID) AS P
      , SUM(1) OVER (PARTITION BY CUSTOMER_ID) AS TRAN_T
    FROM T1 ;
    r_id   cust_id      t_TYPE   T_DATE  CC_CNT  DC_CNT  P_CNT  T_CNT
    101     12345     CC     10-MAR-11     1     1     3     5
    101     12345     DC     07-MAR-11     1     1     3     5
    101     12345     p3     27-OCT-10     1     1     3     5
    101     12345     p2     10-JAN-11     1     1     3     5
    101     12345     P1     01-MAR-11     1     1     3     5
    102     45678     CC     15-FEB-11     1     0     0     1Edited by: PhoenixBai on Mar 14, 2011 4:16 PM

  • Problem with using both group by and order by

    example:
    SQL> select * from orgchart;
    NAME TEAM SALARY SICKLEAVE ANNUALLEAVE
    ADAMS RESEARCH 34000 34 12
    WILKES MARKETING 31000 40 9
    STOKES MARKETING 36000 20 19
    MEZA COLLECTIONS 40000 30 27
    MERRICK RESEARCH 45000 20 17
    RICHARDSON MARKETING 42000 25 18
    FURY COLLECTIONS 35000 22 14
    PERCOURT PR 37500 24 24
    SQL> select team,
    2 avg(salary),avg(sickleave),avg(annualleave)
    3 from orgchart
    4 group by team
    5 order by name;
    order by name
    ERROR at line 5:
    ORA-00979: not a GROUP BY expression
    who can tell me where is wrong?
    Thanks
    Leo

    Hi,
    These are basic things...
    what ever the Columns you are including the Select Clause must
    taken into consideration when applying the group by clause..
    without the selection in of name column how can you use in Order by Clause..
    while using the group by..
    Thanks
    Pavan Kumar N

  • How to call an Oracle Procedure and get a return value in Php

    Hi Everyone,
    Has anyone tried calling an Oracle procedure from Php using the ora functions and getting the return value ? I need to use the ora funtions (no oci)because of compatibility and oracle 7.x as the database.
    The reason why I post this here is because the ora_exec funtion is returning FALSE but the error code displayes is good. Is this a bug in the ora_exec funtion ?
    My code after the connection call is as follows:
    $cur = ora_open($this->conn);
    ora_commitoff($this->conn);
    $requestid = '144937';
    echo $requestid;
    $rc = ora_parse($cur, "begin p_ins_gsdata2
    (:requestid, :returnval); end;");
    if ($rc == true) {
    echo " Parse was successful ";
    $rc2 = ora_bind ($cur, "requestid", ":requestid", 32, 1);
    if ($rc2 == true) echo " Requestid Bind Successful ";
    $rc3 = ora_bind ($cur, "returnval", ":returnval", 32, 2);
    if ($rc3 == true) echo " Returnval Bind Successful ";
    $returnval = "0";
    $rc4 = ora_exec($cur);
    echo " Result = ".$returnval." ";
    if ($rc4 == false) {
    echo " Exec Returned FALSE ";
    echo " Error = ".ora_error($cur);
    echo " ";
    echo "ErrorCode = ".ora_errorcode($cur);
    echo "Error Executing";
    ora_close ($cur);
    The Oracle procedure has a select count from a table and it returns the number of records in that table. It's defined as:
    CREATE OR REPLACE procedure p_ins_gsdata2 (
    p_requestid IN varchar2 default null,
    p_retcode OUT varchar2)
    as
    BEGIN
    SELECT COUNT (*) INTO p_retcode
    FROM S_GSMRY_DATA_SURVEY
    WHERE request_id = p_requestid ;
    COMMIT;
    RETURN;
    END;
    Nothing much there. I want to do an insert into a table,
    from the procedure later, but I figured that I start with a select count since it's simpler.
    When I ran the Php code, I get the following:
    144937
    Parse was successful
    Requestid Bind Successful
    Returnval Bind Successful
    Result = 0
    Exec Returned FALSE
    Error = ORA-00000: normal, successful completion -- while
    processing OCI function OBNDRA
    ErrorCode = 0
    Error Executing
    I listed the messages on separate lines for clarity. I don't understand why it parses and binds o.k. but the exec returns false.
    Thanks again in advance for your help. Have a great day.
    Regards,
    Rudi

    retcode=`echo $?`is a bit convoluted. Just use:
    retcode=$?I see no EOF line terminating your input. Your flavour of Unix might not like that - it might ignore the command, though I'd be surprised (AIX doesn't).
    replace the EXEC line with :
    select 'hello' from dual;
    and see if you get some output - then you know if sqlplus commands are being called from your script. You didn't mentioned whether you see the banner for sqlplus. Copy/paste the output that you get, it will give us much more of an idea.

Maybe you are looking for

  • Inventroy Material Distribution Summary

    Hi everyone, I have query which shows stock value as on date here is my query: SELECT itm.segment1 || '.' || itm.segment2 || '.' || itm.segment3 || '.' || itm.segment4 item_code, ct.organization_code, itm.primary_unit_of_measure primary_uom, itm.desc

  • Can't get bios to start

    Hi I have a problem. I didn't realize what i was getting into when I bought the parts for my PC. I have had no prior experience with computers, but i wanted to get a new one, and my fried said it was alot cheaper to make one than to buy one from HP o

  • Counting records in a specific time block per day

    I have a scenario where I need to find the number of records in a table called 'DEALS', for a specific time frame (in this case 8am until 9am where the date field stores dates in the following format '06/01/2005 08:23:35'). I need to run this query t

  • Transmitting the Purchase order Document to the Vendor.

    Hi All,            There are different modes by which the Purchase Order (PO) Document could be sent to the Vendor from backend R/3 system. The various modes include XML/ Auto email, through Supplier Portal, or manually by means of Fax. How will i ch

  • How do you remove red eye?

    I can't seem to find a red eye removal feature in the app... can anyone help?