Select select order by

Hi,
If I have a table test_order_by with column c1, c2, c3, c4, for example. c1 and c2 together is primary key.
If I run the following query,
select * from test_order_by order by c1, c2;
The result will be in the order of c1, c2.
Now, If I run the following query:
select * from (select * from test_order_by order by c1, c2);
Will the result still be in the same order of c1, c2 ?
Thank you.

Hi,
SQL> select * from emp order by deptno, empno;
     EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
      7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
      7839 KING       PRESIDENT            17-NOV-81       5000                    10
      7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
      7369 SMITH      CLERK           7902 17-DEC-80        800                    20
      7566 JONES      MANAGER         7839 02-APR-81       2975                    20
      7788 SCOTT      ANALYST         7566 09-DEC-82       3000                    20
      7876 ADAMS      CLERK           7788 12-JAN-83       1100                    20
      7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
      7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
      7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
      7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
      7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
      7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
      7900 JAMES      CLERK           7698 03-DEC-81        950                    30
14 rows selected.
SQL> select * from (select * from emp order by deptno, empno);
     EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
      7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
      7839 KING       PRESIDENT            17-NOV-81       5000                    10
      7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
      7369 SMITH      CLERK           7902 17-DEC-80        800                    20
      7566 JONES      MANAGER         7839 02-APR-81       2975                    20
      7788 SCOTT      ANALYST         7566 09-DEC-82       3000                    20
      7876 ADAMS      CLERK           7788 12-JAN-83       1100                    20
      7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
      7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
      7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
      7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
      7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
      7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
      7900 JAMES      CLERK           7698 03-DEC-81        950                    30
14 rows selected.SS

Similar Messages

  • SELECT without ORDER BY - LIFO or FIFO as result?

    Friends, I have a Loop that it inserts in a table that does not possess indice. When I to apply one SELECT, the result will be always the same? This sequencia is important for me. SELECT without ORDER BY functions as a LIFO (stack - Last In, First Out) or FIFO (list/line - First In, First Out)?
    Example:
    declare
    x number := 1;
    Loop
    exit when (x = 11);
    insert into table1 (field1) values (x);
    x: = x + 1;
    end Loop;
    When I will be to apply SELECT in the table ' table1 ' without ODER BY, which result that always will be returned?
    I) 1, 2, 3, ..., 10?
    or will be able to come in another order?
    II) 10, ..., 3, 2, 1
    thanks

    Oracle does not guarantee the rows order when ORDER BY is not specified.
    From Oracle documentation :
    order_by_clause
    Use the ORDER BY clause to order rows returned by the statement. Without an order_by_clause, no guarantee exists that the same query executed more than once will retrieve rows in the same order.

  • You Cannot select assembly order for deletion error with BAPI_SALESORDER_CAHNGE after EHP6 upgrade

    Hi All,
    We are using Z transaction to update Wbs element data to sales order line item through BAPI_SALESORDER_CHANGE. After EHP6 upgrade while updating Wbs element data to old sales orders(Created before EHP6 upgrade)  we are getting  You cannot select assembly order < order number> for deletion (V1 748) error in BAPI return table, For multiple Sales order run.
    But if  we run the same order individually it is getting processed successfully. W e are passing the same values in individual and multiple case.
    We debugged the BAPI and found one more error related to Authorization, But BAPI return table is giving different error (V1 748)message. Please help us in finding the issue.

    Hi Sujay..
    Please check.
    http://help.sap.com/saphelp_47x200/helpdata/en/b7/58c4c87e0811d2b66a0000e82d8bd1/frameset.htm

  • Query:Dispatch selective process orders from a list available

    Hi all,
    we have a requirement in PP module to dispatch only selective process orders(based on a User criteria) from within a Zprogram.To achieve the same,
    1)we have tried to do a BDC of transaction code CM25.But the line selection of the required order to be dispatched is not captured in recording.
    2)Also,we have tried using the CM40 transaction(mass dispatch) and tried to control the orders dispatch through a user exit.This seems to working fine when CM40 is run independently.but the user exit does not get triggered when CM40 is called (using BDC)from within a Zprogram.
    Can someone please throw some light/suggest any alternative for achieving the same i.e dispatch a selected process order from a list of available orders.

    Hi all,
    we have a requirement in PP module to dispatch only selective process orders(based on a User criteria) from within a Zprogram.To achieve the same,
    1)we have tried to do a BDC of transaction code CM25.But the line selection of the required order to be dispatched is not captured in recording.
    2)Also,we have tried using the CM40 transaction(mass dispatch) and tried to control the orders dispatch through a user exit.This seems to working fine when CM40 is run independently.but the user exit does not get triggered when CM40 is called (using BDC)from within a Zprogram.
    Can someone please throw some light/suggest any alternative for achieving the same i.e dispatch a selected process order from a list of available orders.

  • Want to select the Order type automatically when creating production order

    Hi Gurus,
    Please help to select the order type automatically while creting the production order..??
    Please what configuration settings are avialble to make this happen to me.
    THank you in advance.
    Naveen.

    Naveen,
    First priority is the order type defined in the Production schedulling profile(OPKP), assigned to that particular material in workscheduling view. If this is not maintained then,
    Second priority is configuration at MRP Group parameters in transaction in OPPR, this MRP Group if assingned to Material master MRP1 view.
    Third priority is Configuration at Plant level parameters in transaction OPPQ, this defines the order type when convert planned order to Production/Process order.
    Regards,
    Prasobh
    Edited by: Prasobh Karunakaran on May 28, 2009 8:49 PM..added MRP group paramters also

  • Selecting PM order according to status in report

    hello
    we are writing a report in which we need to select PM orders according to several parameters, one of which is a specific User Status.
    I see that there are many tables containing statuses, like TJ20, TJ30, and plenty of others but I cannot find a reference field to connect the status to the PM order.
    meaning: TJ30T for instance has a field TXT04 which contains the user status but, no field for the PM order to find the actual order status to compare.
    how can I connect a specific order to a table containing user status?
    thanks
    Alisa

    Alisa,
    From AUFK table you need to fetch the value for OBJNR for the order number(AUFNR), and using OBJNR value in JEST table you can fetch the status which are active and Inactive.
    Text and status details are available in TJ02.
    Regards,
    Prasobh

  • GR55 reports - How to include multiple selection of Orders in input screen

    Dear Experts
    We r stuck at the simple step in report writer, by which I could select multiple orders in selection screen.
    I am using report liabrary 7KOJ and have used a copy of Std report (7KOJ_001) making a Z one.
    I have comipled everything in this report with many formule to get the required output.
    Now I want to execute thsi report, but I can execute it "only" for one order in selection.
    I tried using another set ( same name) making it repeat at selection scren, but it does not work.
    Is it possible to use multiple orders as selection criterion in this report library  7KOJ?
    Pls guide me if I can use any other liabrary in which I can get
    1. Actual line item costs
    2. Actual line item Qty
    3. Target costs per line item
    4. Target Qty per line iem.
    I am using this particular liabrary becuase I want to get following coloums  in my report with an additional couple of coloumns which I had make some formulae.
    1. Actual cost ( At the time of any line item posting in an order)
    2. Variance ( target Qty valued at actual costs) - * I know that is something strange when you calculate variances, but this is how the requirement is , to calculate variance)
    Pls help. Thanks in advance, as always..
    Regards
    Dhiraj

    Please proceed as follows.  By the way you were doing the right thing just that you did not create the sets correctly.
    1. Create two value variables using transaction code GS11.  For example: OR-AUFN and OR-AUF2  and give default value for both as zero.  The table to use for both is KKBC and the field name as AUFNR
    OR-AUFN - From Order
    OR-AUF2 - To Order
    2. Create a basic set.  For example: OR-S-AUFNR in the basic set, under from value click on variable tab and enter the first variable (OR-AUFN) and then under to value, again click on variable and select the second variable (OR-AUF2) and save.
    3. Now change the report in transaction code GR32. Click on General Data Selection and enter the set you've just created above.  Make sure no other set for Order exists besides the new one and save your report.
    Alternatively, you could also create two value variables for Order Item Number using table KKBC and field POSNR as follows:
    7K-POS1 =  Item from  as description and give default value as 0.
    7K-POS2   =   Item To as description and give default value as 1000
    Next, create a basic set and specify the above two variables.  Change your report and include this set under General Data Selection.  In this scenario, leave your original order set as well.
    That should solve your problem.  Refer back for any further clarification.  By the way, everything I wrote here was tested fully and is working.
    Regards,
    Elias
    Edited by: Elias Akorli on May 5, 2010 4:03 PM
    Edited by: Elias Akorli on May 5, 2010 4:11 PM

  • Error:(in tcodeVA02)"You cannot select assembly order 16600192 for deletion

    when i am trying to delete one line item from sales order using VA02 tcode its throwing error "You cannot select assembly order 16600192 for deletion".
    could you tell me please what might be the reason and how to resolve this issue.
    waiting for your response.
    thanks,
    aritra
    Message was edited by: Aritra Samanta
    Message was edited by: Aritra Samanta

    Let me ask you this: Is the assembly order 16600192 your VA02 order number? If not, your sales order item might have created an assembly order (with this number). Depending on its status, you may not be able to delete the assembly order and therefore the sales order item deletion is not possible.
    Verify the assembly order status.
    Good luck!

  • Field selection for order

    Hi all
    Can I know use of custumization trxn OIXW and OIRS (Field selection for order and sub order data field.)
    My assumption was that when I make sequence chane in OIXW then tht will reflect in IW38/IW39.
    but it is not so.
    Basically I want to araange column sequence in Iw38 as per my requirement. instead of creating layout is there
    any other procedure ?
    Regards,
    Prasad

    Hi,
    Any changes you make in field selection through OIXW or OIRS will reflect in IW38/IW39 as a global default variant.Any user variant created as default variant will have priority over this.So make it sure that this default variant is Protected one so that no one can chnage as you want this to be global variant.
    regds,
    atul

  • Define Field Selection - PM Order

    Hi,
    We have Order types PM01 and PM02, processing for Planning Plants 1000,2000, 3000 and 4000.
    Here for Planning Plant 1000,we have set up Equipment field, as mandatory for both Order type PM01 and PM02. This was set up through, Field Selection for Order Header Data, through Influencing Order type PM01 and PM02 and made Equipment as a mandatory field.
    As this influencing field as made as per Order type PM01 and PM02, for Equipment as mandatory this is applicable for all Plants 1000,2000, 3000 and 4000.
    Now we no need this Equipment as mandatory field in Order type PM01 and PM02 for Plant 4000. For only this requirement, can we make the influencing field for both Order type PM01 and PM02, for only Planning Plant 4000, not  Equipment as a mandatory field.
    This must not disturb the existing Equipment mandatory field for Order types PM01 and PM02 for other Plants 1000, 2000 and 3000.
    Kindly provide your suggestions.
    Raja.

    Kutti Raja,
    If you want to do this for all the order Types for Planning Plant 4000, you may achieve this by following Steps:
    1. Go to Field Selection for Order Header Data and Reference Object (Plant Maintenance and Customer Service --> Maintenance and Service Processing --> Maintenance and Service Orders --> Define Field Selection for Order Header Data (PM))
    2. Click on Influencing button and Double click on "Planning Plant".
    3. Enter "4000" in Contents Fields and Select Radio Button "Input" instead of "Required" next to Equipment field.
    For Rest of the Planning Plants Equipment will remain to be mandatory but for 4000 and all order Types, it will be an input field but not as Mandatory.
    Hope this helps.
    Chin2.

  • Selecting sales order lines by code

    Hi ABAP experts,
    We run into large sales order lines that has different item categories.  There are billing plan lines included in the sales order.
    Say we have 2000 lines in sales order- 30th.210,520,..will be billing plan items. The busines needs an ability for SAP to select the billing plan lines on push of a button.
    If we are able to select the records based out of xvbap-pstyv (itemcategory) , how can we code to select those sales order lines? I am trying to achieve the select sales order line through a coding effort
    Alternatively any other plan?
    Thank you for your time
    Kris
    Edited by: chidam33 on Oct 17, 2011 9:32 PM
    Edited by: chidam33 on Oct 17, 2011 9:32 PM

    Hello,
    "The busines needs an ability for SAP to select the billing plan lines on push of a button." - are you using any report?
    Please check VBKD table where items are listed with billing plan number (FPLNR), you can then check FPLA table
    Thanks

  • Selecting PM orders according to status

    hello
    I need to select PM orders according to several parameters, one of which is a specific User Status.
    I see that there are many tables containing statuses, like TJ20, TJ30, and plenty of others but I cannot find a reference field to connect the status to the PM order.
    meaning: TJ30T for instance has a field TXT04 which contains the user status but, no field for the PM order.
    how can I connect a specific order to a table containing user status?
    thanks
    Alisa

    not well specified

  • Automatic selection of order type during conversion

    When i convert planned order to production order in CO40.Only i put order then press enter.Then the order type flow automatically where the setting has been made for automatic selection of order type

    Hi Debasish,
    The Order type is defined by the production scheduling profile that you maintain in the material master 'work scheduling' view.
    In customizing for the production scheduling profile (CORY), you define the order type associated with the plant, order type and profile combination.
    Regards,
    Pradeep.
    Edited by: Pradeep Rao on Sep 30, 2010 3:18 PM

  • No records selected - SELECT clause with IN

    Hello ABAP Experts
    1st CASE:
    When I execute program below and leave selection screen for S_VBELN and S_ERDAT blank and leave P_AUART to 'PR00", it returns SY-SUBRC = 4. 
    I get no lines returned.
    2nd CASE:
    If I comment out the last 2 lines in my "WHERE" clause of my SELECT, so now my select statement is like this:
            select vbeln erdat auart knumv from vbak into table gt_vbak
                  where vbeln in S_VBELN.
    and leave selection screen for S_VBELN and S_ERDAT blank and leave P_AUART to 'PR00",
    I get lines.  I can even enter a specific order and it will only return that one.
    Can someone explain why my SELECT statement in CASE 1 is not working?
    REPORT  YTEST4.
    tables: vbak.
    SELECT-OPTIONS: S_VBELN for VBAK-VBELN,
                                     S_ERDAT for VBAK-ERDAT.
    PARAMETERS:      P_AUART like vbak-auart default 'PR00' obligatory.
    data: begin of gt_vbak occurs 0,
             vbeln like vbak-vbeln,
             erdat like vbak-erdat,
             auart like vbak-auart,
             knumv like vbak-knumv.
    data: end of gt_vbak.
    START-OF-SELECTION.
      select vbeln erdat auart knumv from vbak into table gt_vbak
            where vbeln in S_VBELN
               and erdat in S_ERDAT
               and auart  = P_AUART.
      loop at gt_vbak.
        write:/ gt_vbak-vbeln, gt_vbak-erdat, gt_vbak-auart, gt_vbak-knumv.
      endloop.

    HI,
    The data format in p_auart may be wrong..
    try this way
    REPORT YTEST4.
    tables: vbak.
    SELECT-OPTIONS: S_VBELN for VBAK-VBELN,
    S_ERDAT for VBAK-ERDAT,
    <b>s _AUART for vbak-auart obligatory no-extension no intervals</b>.
    data: begin of gt_vbak occurs 0,
    vbeln like vbak-vbeln,
    erdat like vbak-erdat,
    auart like vbak-auart,
    knumv like vbak-knumv.
    data: end of gt_vbak.
    initialization.
    s_auart-low = 'PA00'.
    s_auart-opt  = 'I'.
    s_auart-sign = 'EQ'.
    append s_auart.
    START-OF-SELECTION.
    select vbeln erdat auart knumv from vbak into table gt_vbak
    where vbeln in S_VBELN
    and erdat in S_ERDAT
    <b>and auart in s_AUART.</b>
    loop at gt_vbak.
    write:/ gt_vbak-vbeln, gt_vbak-erdat, gt_vbak-auart, gt_vbak-knumv.
    endloop.
    Thanks
    mahesh

  • Is there any object in labview that contains a list of data for the user to select (selection one at a time) or add a new data?

    Is there any object in labview that contains a list of data for the user to select (selection one at a time) or add a new data?

    List and table controls -> listbox..is that what you are thinking of?
    The listbox presents the user with a list of options, and you can set it to only accept one selection at a time...Adding new data to the list can not be done directly by the user but if you make e.g. a text control and a button you can programatically insert new objects described in the text box when the button is pressed...(see example).
    If you need more than one column you have the multicolumn listbox. If you want the users to write new entries directly yu can use a table and read selected cells using it's selection start property to read what cell has been selected.
    MTO
    Attachments:
    Listbox_example.vi ‏34 KB

  • I need to Sync/change my iPhone contacts but I can't select "Selected Groups"...?

    I need to Sync/change my iPhone contacts but I can't select "Selected Groups"...?

    This is what worked for me. Turned off icloud on iphone and computer. Logged into my icloud account at icloud.com via my web browser and deleted all of my contacts and calendars. I was then able to select selected contacts and selected calendars in iTunes.

Maybe you are looking for