Return the top 3 records only.

Hello !
I wonder if someone could help me with a question.
I have some SQL
SELECT * FROM JOBS ORDER BY SALARY
Now I only want to return the top three records, in SQL Server I would do the following.
SELECT TOP 3 FROM JOBS ORDER BY SALARY
Is there anyway to return just the top records in this maner in Oracle.
Many THanks

select * from
  (select dense_rank() over (order by sal desc) r, emp.* from emp)
where r<=3
         R      EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
         1       7839 KING       PRESIDENT            17.11.1981 00:00:00       5000                    10
         2       7788 SCOTT      ANALYST         7566 19.04.1987 00:00:00       3000                    20
         2       7902 FORD       ANALYST         7566 03.12.1981 00:00:00       3000                    20
         3       7566 JONES      MANAGER         7839 02.04.1981 00:00:00       2975                    20

Similar Messages

  • Simple Query Question - How do I return the Last 3 records of a Table?

    Question.
    For example, I have a table that has 50 records.
    How do I, specify in SQL to only return the last 3 records of the table.
    Select a.* from table a where ????

    I was just trying to show an example to a friend on
    how something like this would work and if it was even possible. But it won't work. Here's a simple example:
    SQL> create table emp
      2  (id)
      3  as
      4  select object_id
      5  from   all_objects
      6  order  by object_id;
    Table created.
    SQL> select *
      2  from  (select rownum rn
      3               ,b.*
      4         from   emp b)
      5  where  rn > ( select (max(rownum) - 3)
      6                from    emp)
      7  ;
            RN         ID
         40830      55891
         40831      55892
         40832      55893So far, so good. These are the "last 3" rows inserted. Now delete a bunch of rows and insert 3 new ones:
    SQL> delete emp where id < 40000;
    33423 rows deleted.
    SQL> commit;
    Commit complete.
    SQL> insert into emp values (60000);
    1 row created.
    SQL> insert into emp values (60001);
    1 row created.
    SQL> insert into emp values (60002);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select *
      2  from  (select rownum rn
      3               ,b.*
      4         from   emp b)
      5  where  rn > ( select (max(rownum) - 3)
      6                from    emp)
      7  ;
            RN         ID
          7410      55891
          7411      55892
          7412      55893Here's the problem. Even though the "last 3 rows" are 60000 - 60002, I still get the same ones as the first query.

  • Whether its possible for calculating Grand total the Top 20 records?how?plz

    Hi Experts,
    could you please let me know that whether the Grand total can be calculated by selecting the Top 20 records from the table.
    please....its urgent......

    I agree with Christian, we need additional clarification.
    If you are looking for a report which shows only the Top 20 records and a Grand Total, here are the steps you follow:
    1. From the Criteria tab in Answers, create a filter on the column you wish to show only the top 20 records.
    2. Set Operator to - "Is in top"
    3. Set Value to - "20"
    From there - go to the results tab. Locate the data column you would like to "count" and select the "total by" button. (Looks like an E)
    Hope this helps. If you are looking for something else, please provide us with a more detailed explanation.
    Thanks.

  • Which system field returns the number of records returned after a select?

    Which system field returns the number of records returned after a select?
    a) sy-index
    b) sy-recno
    c) sy-lncnt
    d) sy-dbcnt
    e) sy-tabix

    Hi,
       SY-DBCNT
    Regards,
    Prashant

  • When uploading videos to iWeb, the video screen gets cut off at the top. It only happens in Firefox, but not in Safari.

    When uploading videos to iWeb, the video screen gets cut off at the top. It only happens in Firefox, but not in Safari. Has anybody else had this problem?

    I'm using pure HTML5 for mobile websites although you need to provide an OGG file for Firefox. See the movie page on this site...
    http://mobile.ezmacwebdesign.com/
    If you don't have an iPhone, grab the browser handle and drag it to the left to reduce the width to see how it responds to mobile devices' fixed width browsers .
    This will play in all modern browsers and on mobile devices. You can use QuickTime Pro for the OGG or OGV conversion or get the freeware Miro Video Converter...
    http://www.iwebformusicians.com/Website-Movie-Video/Easy-Movie-Player.html
    If you only want to upload an MP4, you can use a flash fallback player and this will cover Firefox and those geriatrics that still use older versions of Internet Explorer....
    http://www.iwebformusicians.com/Website-Movie-Video/Flow-Player.html
    http://www.iwebformusicians.com/Website-Movie-Video/Fallback-To-Flash.html
    http://www.iwebformusicians.com/Website-Movie-Video/JW-Media-Player.html
    If you use any of the four fallback players above, take advantage of the fact that you can add a poster image and stop the video file from preloading. This makes for a faster page download time.
    You can also achieve this using HTML5 by adding preload="none" and poster="URL to the poster image" into the code shown on this page...
    http://www.iwebformusicians.com/Website-Movie-Video/HTML5-Video.html

  • I would like to return the top 50 most popular words

    HI, I have a text column in mssql, I would like to return the
    top 50 most popular words and their count(for all rows) excluding
    the words
    i
    a
    it
    the
    Any clue how to do this?

    I done it with code like this, but it took about 200 seconds to finish and generated 300000 rows in WORDS
    it would be cool if it could be done in pure sql, mabye it could be done using ms sql cursors
    <cfset datasource = application.datasource>
    <cfset datasource = application.datasource>
    <cfquery name="q" datasource="#datasource#">
         select   * from    staff
    </cfquery>
    <cfloop query="q">
      <cfloop list="#comment#" index="word" delimiters=" ,?,.,!,;#chr(10)##chr(13)#">
        <cfquery name="q2" datasource="#datasource#">
                 insert into WORDS values(
                  <cfqueryparam value="#word#"     cfsqltype="cf_sql_varchar">  
                </cfquery>
      </cfloop>
    </cfloop>

  • Trying to get the top N records from a query.

    Hello,
    Im trying to get the top N records of a random query. I've been looking for a decent solution for a while now and the 2 solutions I've come across are:
    select *
    from (select * from qrs_klantgroepen order by code) a
    where rownum < 10
    ORA-00907: missing right parenthesis
    The query works when I remove the order clause from the subquery, but it's mandatory to get the results I need.
    The next solution:
    select *
    from (select code, row_number() over (order by code) from qrs_klantgroepen) a
    where rownum < 10
    ORA-00923: FROM keyword not found where expected
    Apparently the construct used here isn't supported by my oracle version.
    I'm using oracle Oracle8 Enterprise Edition Release 8.0.5.2.1.
    Is there another way I can achieve the results I want?
    Looking forward to your replies.
    Frederik

    it must be nostalgy, but I would try something like
    SQL> select * from emp e where 5>(select count(*) from emp where ename<e.ename) order by ename;
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7876 ADAMS      CLERK           7788 1987-05-23_00:00:00       1100                    20
          7499 ALLEN      SALESMAN        7698 1981-02-20_00:00:00       1600        300         30
          7698 BLAKE      MANAGER         7839 1981-05-01_00:00:00       2850                    30
          7782 CLARK      MANAGER         7839 1981-06-09_00:00:00       2450                    10
          7902 FORD       ANALYST         7566 1981-12-03_00:00:00       3000                    20
    SQL> select * from (select * from emp order by ename) where rownum<6;
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7876 ADAMS      CLERK           7788 1987-05-23_00:00:00       1100                    20
          7499 ALLEN      SALESMAN        7698 1981-02-20_00:00:00       1600        300         30
          7698 BLAKE      MANAGER         7839 1981-05-01_00:00:00       2850                    30
          7782 CLARK      MANAGER         7839 1981-06-09_00:00:00       2450                    10
          7902 FORD       ANALYST         7566 1981-12-03_00:00:00       3000                    20Message was edited by:
    Laurent Schneider

  • Returning the number of records retrieved by a query

    Hi everyone,
    I did a search on this question, but I'm still unclear as to why it's so difficult to retrieve the number of records returned by a query.
    What is the easiest and most straight-foward way ?
    Thanks,
    Bob

    Shay
    I am confused. I still do not know how to achieve the count of records retrieved in a block. I have viewed the viewlet calculated field demo. I am unclear of what you were refering to when you said use the count as the function.
    I did try setting function to be "get_block_property('myblock',query_hits)", but this always had value of zero. But I do not think this is what you meant.
    Has anybody been able to answer the original question?

  • The tabs on Mozilla ux are barely visible(the top half is only shown). How to fix this?

    I have already tried restarting the browser without ad-dons. The problem occurred after last nights update.

    This is in Firefox 25 -- also known as "Nightly"? I'm very unfamiliar with UI changes that might be in that version...
    Could you test in a new Firefox profile? In addition to bypassing current add-ons and custom settings, it should have completely fresh settings databases and a fresh cache folder.
    Exit Firefox and start up in the Profile Manager as described in [[Use the Profile Manager to create and remove Firefox profiles]]. To switch back to your default profile, you also would exit Firefox and return to this dialog.
    To avoid data loss, I recommend using the default location suggested (not any folder with existing files), and not deleting any profiles without making backups first.
    Does the tab bar look normal in the new profile?

  • CONNECT BY with a join, keeping the top joined record  for the entire tree?

    Faced with a Groupe TABLE, and a Groupe_Role TABLE, i am trying to get a user's rights FROM Groupe_Role for each and every member in Groupe. However, the user's rights should be the same right as where we entered the tree.
    Here are sample TABLEs, with my attempt at a query, which obviously does not work because the WHERE clause limits the records from the tree.
    WITH
         Groupe
    AS
          SELECT 1 Id, 'cupboards'      Name, NULL     Parent FROM Dual UNION ALL
          SELECT 2 Id, 'book-shelves'      Name, 1     Parent FROM Dual UNION ALL
          SELECT 3 Id, 'maps'           Name, NULL     Parent FROM Dual UNION ALL
          SELECT 4 Id, 'pictures'      Name, 3     Parent FROM Dual UNION ALL
          SELECT 5 Id, 'pegs'           Name, 4     Parent FROM Dual UNION ALL
          SELECT 6 Id, 'jar'           Name, NULL     Parent FROM Dual UNION ALL
          SELECT 7 Id, 'orange marmalade' Name, 6     Parent FROM Dual UNION ALL
          SELECT 8 Id, 'sticks'           Name, NULL     Parent FROM Dual UNION ALL
          SELECT 9 Id, 'dry leaves'      Name, 8     Parent FROM Dual
         Groupe_Role
    AS
          SELECT 1 Groupe, 'Charles'     Member, 'Keeper'     Role FROM Dual UNION ALL
          SELECT 2 Groupe, 'Charles'     Member, 'Player'     Role FROM Dual UNION ALL
          SELECT 3 Groupe, 'Lewis'     Member, 'Keeper'     Role FROM Dual UNION ALL
          SELECT 1 Groupe, 'Alice'     Member, 'Player'     Role FROM Dual UNION ALL
          SELECT 3 Groupe, 'Alice'     Member, 'Player'     Role FROM Dual UNION ALL
          SELECT 6 Groupe, 'Alice'     Member, 'Player'     Role FROM Dual UNION ALL
          SELECT 8 Groupe, 'Alice'     Member, 'Player'     Role FROM Dual
    SELECT
         Groupe.Id,
         Groupe.Name,
         Groupe_Role.Member,
         Groupe_Role.Role
    FROM
         Groupe_Role,
         Groupe
    WHERE
         Groupe.Id = Groupe_Role.Groupe
    CONNECT BY
         Groupe.Parent = PRIOR Groupe.Id
    START WITH
         Groupe.Parent IS NULL
    ORDER BY
         Groupe_Role.Member,
         Groupe_Role.Groupe;The results i am looking for are as follows:
    1 Alice      Player 'cupboards'
    2 Alice      Player 'book-shelves'
    3 Alice      Player 'maps'
    4 Alice      Player 'pictures'
    5 Alice      Player 'pegs'
    6 Alice      Player 'jar'
    7 Alice      Player 'orange marmalade'
    8 Alice      Player 'sticks'
    9 Alice          Player 'dry leaves'
    1 Charles     Keeper 'cupboards'
    2 Charles     Keeper 'book-shelves'
    2 Charles     Player 'book-shelves'
    3 Lewis      Keeper 'maps'
    4 Lewis      Keeper 'pictures'
    5 Lewis      Keeper 'pegs'How would i write such a query?

    It's amazing what a little legwork will do:
    10g: CONNECT_BY_ROOT Id Root_Id,
    9i:     REPLACE(SYS_CONNECT_BY_PATH(DECODE(Level, 1, Id), '~'), '~')
    WITH
         Groupe
    AS
          SELECT 1 Id, 'cupboards'      Name, NULL     Parent FROM Dual UNION ALL
          SELECT 2 Id, 'book-shelves'      Name, 1     Parent FROM Dual UNION ALL
          SELECT 3 Id, 'maps'           Name, NULL     Parent FROM Dual UNION ALL
          SELECT 4 Id, 'pictures'      Name, 3     Parent FROM Dual UNION ALL
          SELECT 5 Id, 'pegs'           Name, 4     Parent FROM Dual UNION ALL
          SELECT 6 Id, 'jar'           Name, NULL     Parent FROM Dual UNION ALL
          SELECT 7 Id, 'orange marmalade' Name, 6     Parent FROM Dual UNION ALL
          SELECT 8 Id, 'sticks'           Name, NULL     Parent FROM Dual UNION ALL
          SELECT 9 Id, 'dry leaves'      Name, 8     Parent FROM Dual
         Groupe_Role
    AS
          SELECT 1 Groupe, 'Charles'     Member, 'Keeper'     Role FROM Dual UNION ALL
          SELECT 2 Groupe, 'Charles'     Member, 'Player'     Role FROM Dual UNION ALL
          SELECT 3 Groupe, 'Lewis'     Member, 'Keeper'     Role FROM Dual UNION ALL
          SELECT 1 Groupe, 'Alice'     Member, 'Player'     Role FROM Dual UNION ALL
          SELECT 3 Groupe, 'Alice'     Member, 'Player'     Role FROM Dual UNION ALL
          SELECT 6 Groupe, 'Alice'     Member, 'Player'     Role FROM Dual UNION ALL
          SELECT 8 Groupe, 'Alice'     Member, 'Player'     Role FROM Dual
    SELECT
         Groupe_Trees.Id,
         Groupe_Trees.Name,
         Groupe_Role.Member,
         Groupe_Role.Role
    FROM
         Groupe_Role,
          SELECT
              --CONNECT_BY_ROOT Id Root_Id,
              REPLACE(SYS_CONNECT_BY_PATH(DECODE(Level, 1, Id), '~'), '~') Root_Id,
              Id,
              Name
          FROM
              Groupe
          CONNECT BY
              Groupe.Parent = PRIOR Groupe.Id
         ) Groupe_Trees
    WHERE
         Groupe_Role.Groupe = Groupe_Trees.Root_Id
    ORDER BY
         Groupe_Role.Member,
         Groupe_Trees.Id;

  • Only Return the latest issue of a document

    Hi all,
    I am trying to work out a script to only return the latest issue of a document. In the example below if I was using the correct statement I would only return the issue 3 records (AAA and AAB)
    I am not sure what syntax/operator to use, can anyone help me..
    Document Issue
    AAA 1
    AAA 2
    AAA 3
    AAB 1
    AAB 2
    AAB 3
    I have tried the group by expression and the MAX operator...... to no avail....

    Is this what you need?
    SQL> CREATE TABLE dt_test_docs (        doc_id varchar2(10),
      2                                                     ver number,
      3                                                     updated_by varchar2(10),
      4                                                     updated_timestamp timestamp
      5                                             )
      6  /
    Table created.
    SQL> INSERT INTO dt_test_docs
      2  VALUES('ABC',1,'user1',systimestamp-3)
      3  /
    1 row created.
    SQL> INSERT INTO dt_test_docs
      2  VALUES('ABC',2,'user2',systimestamp-2)
      3  /
    1 row created.
    SQL> INSERT INTO dt_test_docs
      2  VALUES('ABC',3,'user2',systimestamp-1)
      3  /
    1 row created.
    SQL> INSERT INTO dt_test_docs
      2  VALUES('ABC',4,'user3',systimestamp)
      3  /
    1 row created.
    SQL> INSERT INTO dt_test_docs
      2  VALUES('DEF',1,'user3',systimestamp-3)
      3  /
    1 row created.
    SQL> INSERT INTO dt_test_docs
      2  VALUES('DEF',2,'user3',systimestamp-2)
      3  /
    1 row created.
    SQL> INSERT INTO dt_test_docs
      2  VALUES('DEF',3,'user2',systimestamp-1)
      3  /
    1 row created.
    SQL> INSERT INTO dt_test_docs
      2  VALUES('DEF',4,'user1',systimestamp)
      3  /
    1 row created.
    SQL>
    SQL> SELECT
      2     doc_id,
      3     ver,
      4     updated_by,
      5     updated_timestamp,
      6     max_ver
      7  FROM
      8     (
      9     SELECT
    10             doc_id,
    11             ver,
    12             updated_by,
    13             updated_timestamp,
    14             MAX(ver) OVER(PARTITION BY doc_id) max_ver
    15     FROM
    16             dt_test_docs
    17     )
    18  WHERE
    19     max_ver = ver
    20  /
    DOC_ID            VER UPDATED_BY UPDATED_TIMESTAMP                                                      MAX_VER
    ABC                 4 user3      06-SEP-06 05.31.19.242000 PM                                                 4
    DEF                 4 user1      06-SEP-06 05.31.19.304000 PM                                                 4

  • Oracle Forms returns the first record in the database when performing query

    Once in a while when we query for a record on a form, say by first name Tom, then it returns the first record in the database. Other times it return the Tom's record. It only happens once in a while and if you close the form and reopen it and requery for Tom, then it brings Tom's record.
    Does anyone know the issue what could be happening. It just happens every now and then that it's hard to reproduce.
    ORacle Forms 10GR2
    ORacle Application Server 10.1.3
    thanks

    then it returns the first record in the databaseI'm not sure if i understand you correctly. Do you mean forms ignores the searc-condition you entered? I would check SYSTEM.LAST_QUERY at the moment this happens to check if the condition gets somehow lost.

  • OraDynaSet not returning the correct number of records.

    Hello All, I am writing VB code in Excel 2007 and retrieving records from a Oracle 9i database. When I run my query from TOAD or any other sql app I get 56 records returned for certain query. However, when I do it from VB in excel and write the values to the excel file, it will not return the last 3 records, any suggestions? Here is part of my code:
    Worksheets("Report").Range("A3").Value = ""
    Worksheets("Report").Range("B3").Value = "Period"
    Worksheets("Report").Range("C3").Value = "Budget"
    Worksheets("Report").Range("D3").Value = "Projected"
    strSQL = "select group_name,period_name,budget_value,budget_value project from nlas_bdgt_loading_stg where plant = " & plant & " and group_number = 1 order by group_number, period_num"
    Set OraDynaSet = objDataBase.DBCreateDynaset(strSQL, 0&)
    If OraDynaSet.RecordCount > 0 Then
    OraDynaSet.MoveFirst
    'Loop the recordset for returned rows
    For i = 4 To OraDynaSet.RecordCount
    'Put the results in columns
    ActiveSheet.Cells(i, 1) = OraDynaSet.Fields(0).Value
    ActiveSheet.Cells(i, 2) = OraDynaSet.Fields(1).Value
    ActiveSheet.Cells(i, 3) = OraDynaSet.Fields(2).Value
    ActiveSheet.Cells(i, 4) = OraDynaSet.Fields(3).Value
    OraDynaSet.MoveNext
    Next i
    End If
    Thanks,
    Chris

    Hello.
    It's a bit weird. It works for me. If you have a look at oo4o help:
    CopyToClipboard Method
    Example
    Applies To
    OraDynaset
    Description
    Copy the rows from the dynaset to the Clipboard in text format.
    Usage
    OraDynaset.CopyToClipboard(NumOfRows ,colsep [optional],rowsep [optional] )
    Arguments
    NumOfRows     Number of rows to be copied to the dynaset ,
    colsep     Column separator in CHAR to be inserted between columns
    rowsep     Row seperater in CHAR to be inserted between Rows
    Remarks
    This method is used to facilitate transfer of data between Oracle Object for OLE’s cache (dynaset) and Windows applications such as Excel or Word. CopyToClipboard copies data starting from current position of the dynaset up to the last row.
    Default column separator is TAB (ASCII 9).
    Default row separator is ENTER (ASCII 13).
    Can it be that you don't have all the References needed?
    Octavio

  • How to select top 10 records

    How can I use SQL to select the top 10 records (do not use cursor)

    ... not only that but the order by and rownum check cannot be done in the same select. You need an in-line view.
    select * from
    (select * from table
    order by whatever)
    where rownum < 11
    BEWARE: Incorrect use of rownum (which is very common) often returns the correct result by accident, but you cannot guarantee that the accident will continue to happen.

  • How to print a value at the top of each page in the detail section of a rpt

    Thanks for helping, I will try to get right to the point.
    I have RTF template. Very simplistic template. I have the Group at the top (there is only 1 per XML file) and several DETAIL lines with like 10 columns.
    The first displayed field is "ACCOUNT_NUMBER". The user wished that if the ACCOUNT NUMBER for line 2 was the same as line 1, that it be suppressed, for example:
    Acct No other other other other
    1234 XX XX XX XX
    YY YY YY YY
    This was not a problem, I was able to accomplish it with the following code:
    <?if:position()=1 or ACCOUNT_NUMBER!=preceding::ACCOUNT_NUMBER[1]?><?ACCOUNT_NUMBER?><?end if?>
    But what happens is that IF THE FIRST line on a page has the same ACCOUNT_NUMBER as the last line on the previous page, the ACCOUNT NUMBER is not displayed.
    What I would like is for the ACCOUNT NUMBER to be displayed anytime we are at the first record on a page, AND anytime it is different from the previous record's value.
    I do not know how many lines per page are possible, because there are other line breaks which exist which put a space between lines when values change too. So I cannot just count how many total lines and divide it by lines per page.
    My thought was that there must be a way I could store a variable called LAST_PAGE, and at the end of each record, copy the current page number to that variable. Then in my ACCOUNT_NUMBER code, I could check if current page is NOT equal to last page along with my other conditions.
    1. Is this the best way to do this? If so, please help, I am new to BI and am having trouble figuring out where to put variables and stuff like that.
    2. If not, how can I do this?
    3. If your recommendation is going to be to group my items by Account Number, I may not have time to redo the report that way. I will happily supply the rtf and xml if that will help you help me.
    Regards:
    Michael Coughlin

    Here ya go. Obviously you can duplicate the G_DETAILS blocks to get enough for 2 pages. I have the data pre-sorted before the output is generated because I had trouble getting the RTF to work if I didn't, just so you know.
    <?xml version="1.0" encoding="UTF-8" ?>
    <!-- Generated by Oracle Reports version 6.0.8.28.0 -->
    <XXDIPICK_RPT>
    <LIST_G_HEADERS>
    <G_HEADERS>
    <SHIP_FROM_ORG_CODE>202</SHIP_FROM_ORG_CODE>
    <LINE_STATUS>Picked</LINE_STATUS>
    <LIST_G_DETAILS>
    <G_DETAILS>
    <SHIP_FROM_ORG_CODE1>202</SHIP_FROM_ORG_CODE1>
    <ACCOUNT_NUMBER>1000</ACCOUNT_NUMBER>
    <DELIVERY_NUMBER>8062</DELIVERY_NUMBER>
    <ORDER_NUMBER>103049</ORDER_NUMBER>
    <CUST_NAME>DIAMOND INNOVATIONS INT SALES - NEWCO</CUST_NAME>
    <DELIVERY_DETAIL_ID>12474</DELIVERY_DETAIL_ID>
    <LINE_NO>1.1</LINE_NO>
    <ITEM_NO>4087401</ITEM_NO>
    <ITEM_DESCRIPTION>HPD M SD-CTO-0 Pot</ITEM_DESCRIPTION>
    <OPEN_FLAG>Y</OPEN_FLAG>
    <CANCELLED_FLAG>N</CANCELLED_FLAG>
    <BOOKED_FLAG>Y</BOOKED_FLAG>
    <ORDERED_QUANTITY>1</ORDERED_QUANTITY>
    <ORDER_QUANTITY_UOM>EA</ORDER_QUANTITY_UOM>
    <SHIPPED_QUANTITY></SHIPPED_QUANTITY>
    <SCHEDULE_SHIP_DATE>2011-01-31T23:59:00+00:00</SCHEDULE_SHIP_DATE>
    <NAME>INTERNAL ORDER - US</NAME>
    <CUST_ACCOUNT_ID>16404</CUST_ACCOUNT_ID>
    <HEADER_ID>6446</HEADER_ID>
    <LINE_ID>7926</LINE_ID>
    <ORG_ID>84</ORG_ID>
    <SHIP_TO_ORG_ID>16050</SHIP_TO_ORG_ID>
    <INVOICE_TO_ORG_ID>16052</INVOICE_TO_ORG_ID>
    <SHIP_SET_ID></SHIP_SET_ID>
    <INVENTORY_ITEM_ID>63927</INVENTORY_ITEM_ID>
    </G_DETAILS>
    <G_DETAILS>
    <SHIP_FROM_ORG_CODE1>202</SHIP_FROM_ORG_CODE1>
    <ACCOUNT_NUMBER>1000</ACCOUNT_NUMBER>
    <DELIVERY_NUMBER>8062</DELIVERY_NUMBER>
    <ORDER_NUMBER>103049</ORDER_NUMBER>
    <CUST_NAME>DIAMOND INNOVATIONS INT SALES - NEWCO</CUST_NAME>
    <DELIVERY_DETAIL_ID>12475</DELIVERY_DETAIL_ID>
    <LINE_NO>2.1</LINE_NO>
    <ITEM_NO>3732307</ITEM_NO>
    <ITEM_DESCRIPTION>NV MBS 2325 Bushing Asm</ITEM_DESCRIPTION>
    <OPEN_FLAG>Y</OPEN_FLAG>
    <CANCELLED_FLAG>N</CANCELLED_FLAG>
    <BOOKED_FLAG>Y</BOOKED_FLAG>
    <ORDERED_QUANTITY>1</ORDERED_QUANTITY>
    <ORDER_QUANTITY_UOM>EA</ORDER_QUANTITY_UOM>
    <SHIPPED_QUANTITY></SHIPPED_QUANTITY>
    <SCHEDULE_SHIP_DATE>2011-01-31T23:59:00+00:00</SCHEDULE_SHIP_DATE>
    <NAME>INTERNAL ORDER - US</NAME>
    <CUST_ACCOUNT_ID>16404</CUST_ACCOUNT_ID>
    <HEADER_ID>6446</HEADER_ID>
    <LINE_ID>7927</LINE_ID>
    <ORG_ID>84</ORG_ID>
    <SHIP_TO_ORG_ID>16050</SHIP_TO_ORG_ID>
    <INVOICE_TO_ORG_ID>16052</INVOICE_TO_ORG_ID>
    <SHIP_SET_ID></SHIP_SET_ID>
    <INVENTORY_ITEM_ID>67865</INVENTORY_ITEM_ID>
    </G_DETAILS>
    <G_DETAILS>
    <SHIP_FROM_ORG_CODE1>202</SHIP_FROM_ORG_CODE1>
    <ACCOUNT_NUMBER>46711</ACCOUNT_NUMBER>
    <DELIVERY_NUMBER></DELIVERY_NUMBER>
    <ORDER_NUMBER>102980</ORDER_NUMBER>
    <CUST_NAME>VAREL EUROPE</CUST_NAME>
    <DELIVERY_DETAIL_ID>12356</DELIVERY_DETAIL_ID>
    <LINE_NO>1.1</LINE_NO>
    <ITEM_NO>11004002</ITEM_NO>
    <ITEM_DESCRIPTION>TYPE I 100/120 MISC</ITEM_DESCRIPTION>
    <OPEN_FLAG>Y</OPEN_FLAG>
    <CANCELLED_FLAG>N</CANCELLED_FLAG>
    <BOOKED_FLAG>Y</BOOKED_FLAG>
    <ORDERED_QUANTITY>75</ORDERED_QUANTITY>
    <ORDER_QUANTITY_UOM>CT</ORDER_QUANTITY_UOM>
    <SHIPPED_QUANTITY></SHIPPED_QUANTITY>
    <SCHEDULE_SHIP_DATE>2011-01-27T23:59:00+00:00</SCHEDULE_SHIP_DATE>
    <NAME>STANDARD ORDER - IRE</NAME>
    <CUST_ACCOUNT_ID>5004</CUST_ACCOUNT_ID>
    <HEADER_ID>6234</HEADER_ID>
    <LINE_ID>7312</LINE_ID>
    <ORG_ID>85</ORG_ID>
    <SHIP_TO_ORG_ID>18929</SHIP_TO_ORG_ID>
    <INVOICE_TO_ORG_ID>4995</INVOICE_TO_ORG_ID>
    <SHIP_SET_ID></SHIP_SET_ID>
    <INVENTORY_ITEM_ID>42032</INVENTORY_ITEM_ID>
    </G_DETAILS>
    <G_DETAILS>
    <SHIP_FROM_ORG_CODE1>202</SHIP_FROM_ORG_CODE1>
    <ACCOUNT_NUMBER>76127</ACCOUNT_NUMBER>
    <DELIVERY_NUMBER>7608</DELIVERY_NUMBER>
    <ORDER_NUMBER>102981</ORDER_NUMBER>
    <CUST_NAME>LION ENGINEERING SERVICES LTD</CUST_NAME>
    <DELIVERY_DETAIL_ID>12357</DELIVERY_DETAIL_ID>
    <LINE_NO>1.1</LINE_NO>
    <ITEM_NO>11004002</ITEM_NO>
    <ITEM_DESCRIPTION>TYPE I 100/120 MISC</ITEM_DESCRIPTION>
    <OPEN_FLAG>Y</OPEN_FLAG>
    <CANCELLED_FLAG>N</CANCELLED_FLAG>
    <BOOKED_FLAG>Y</BOOKED_FLAG>
    <ORDERED_QUANTITY>200</ORDERED_QUANTITY>
    <ORDER_QUANTITY_UOM>CT</ORDER_QUANTITY_UOM>
    <SHIPPED_QUANTITY></SHIPPED_QUANTITY>
    <SCHEDULE_SHIP_DATE>2011-01-27T23:59:00+00:00</SCHEDULE_SHIP_DATE>
    <NAME>STANDARD ORDER - IRE</NAME>
    <CUST_ACCOUNT_ID>5614</CUST_ACCOUNT_ID>
    <HEADER_ID>6235</HEADER_ID>
    <LINE_ID>7318</LINE_ID>
    <ORG_ID>85</ORG_ID>
    <SHIP_TO_ORG_ID>18429</SHIP_TO_ORG_ID>
    <INVOICE_TO_ORG_ID>5605</INVOICE_TO_ORG_ID>
    <SHIP_SET_ID></SHIP_SET_ID>
    <INVENTORY_ITEM_ID>42032</INVENTORY_ITEM_ID>
    </G_DETAILS>
    </LIST_G_DETAILS>
    </G_HEADERS>
    </LIST_G_HEADERS>
    </XXDIPICK_RPT>

Maybe you are looking for