Group based on value range and order with in group

Hi All,
I have a scenario like to group record set based on a value set.
Example.
Table data_table has 10 columns of which one column grouping_col can have value from 10 - 100
i have to retreive a report with multiple order by clause with a precondition that
record having grouping_col having 10-50 should be processed first then,
record having grouping_col having 50-60 should be processed next and then so on untill 100.
Is there a way to do this without union funcitonality.

Please read the SQL and PL/SQL FAQ:
SQL and PL/SQL FAQ
especially the second question regarding how to post a question on the forums.

Similar Messages

  • Get Process Order List Based on Date Range and Order Status

    Hi all,
    Iam using BAPI_PROCORD_GET_LIST to get the entire list of Process Orders based on selection criteria as plant. However I have noticed that there's no selection option to get records between start and finish times neither does any option exists to get only the released or open orders.
    To filter records based on Start Date/Finish date or get records with specific status, we need to get the entire list of records that exists for a plant and then use repeater/condition action to filter the same. Fetching the complete list and then filtering is an overhead. Does anyone know a solution to this or does anyone have been in this situation ? Is there any other BAPI that supports the filter criteria to get open/released orders from SAP. Do we need to modify the BAPI to include Process Order start date and end date or System status as selection options ?
    Appreciate your help !
    Regards,
    Gilmour

    Hi Gilmour
    I would say you have 2 options here..
    1. Create a new RFC with the search params as you want them. Write the logic accordingly.
    2. Use the Enterprise services for Production Order where you can say you want Process Orders. The Service that has Planned Start Date and End Date along with Status is ProductionOrderSimpleByElementsQuery_sync. See Link [here|http://esworkplace.sap.com/socoview(bD1lbiZjPTAwMSZkPW1pbg==)/render.asp?id=D507C16176BE11DA36BB000F20DAC9EF&fragID=&packageid=DE0426DD9B0249F19515001A64D3F462&iv=]
    This service is available from ECC 600 onwards.
    You can call the Enterprise Services using the Web Service Action block.
    Regards
    Partha

  • Regarding Lightroom Slideshow module: When I click on the preview button I get the following error: An internal error has occurred: ?:0: attempt at index a nil value. This occurs with any group of images I select in my catalog.

    Regarding Lightroom Slideshow module: When I click on the preview button I get the following error: An internal error has occurred: ?:0: attempt at index a nil value. This occurs with any group of images I select in my catalog.

    Jeannine,
         If you follow the advice of the previous poster Julie Kmoch and then gradualy add presets back in one at a time you might be able to find the one that is causing the issue. I may be guessing, but I believe the issue has something to do with either an incompatible Preset setting (eg a older preset in newer version of LR) or a corrupt Preset.
    Say you bought LR2 and imported a bunch of Presets from the internet, cuz 'Hey these effects are cool and I don't have to recreate the wheel', and then you upgraded to LR3 (not a clean install) and now one of the Presets that calls a certain slider setting or value that is different in LR3 doesn't work anymore. This might be why it throws the error, but again I am just speculating.
    Location of LR Preset folder in Windows Vista/ Windows 7
    C:/Users/<YourUserName>/AppData/Roaming/Adobe/Lightroom/Develop Presets
    If you do not see the folder AppData, you may need to change the settings in Windows Explorer to 'Show Hidden Files and Folders'. To do that in Windows Vista/ Windows 7, open a Windows Explorer window, Click on Organize, then Foler and Search Options. Then click on the View tab and select the option button next to Show hidden files, folders and drives.
    Hope this helps a bit,
    Glenn

  • How to get  shipped orders, unshipped orders and orders with open deliverie

    Hi
    how to get  shipped orders, unshipped orders and orders with open deliveries
    can anybody answer this.
    points would be rewrded
    Thanks

    Hi,
    You can check in the VBUK table for the status of an order. If you do a Query on VBUK table to get all the orders whose delivery status is not 'C' or the total goods movement status is not 'C' you get to know the orders not yet shipped.
    Hope this helps. Reqard points if useful.
    David.

  • MDG-S BP Grouping,BP Role,BP Categeory and ERP Vendoe Account Group

    Hi
    Can anybody explains me releationship between MDG-S BP Grouping,BP Role,BP Categeory and ERP Vendoe Account Group?
    It seems there is no requried field except Change Request Description.If we input value for CR Description only, we can still able to sumbit and activate CR and Bussiner Partner ID (Which is internally generated) will be stored in MDG stagging table for entity type BP_HEADER.
    My question is then what is use of BP Grouping,BP role in this as it contains blank value? Also it observed that for new ERP Vendor the Account Group field is always in non editable mode,Any reason for this? Same issue with Company Code after selecting CC it displayed as non editable field before submitting CR as well.

    Hi Sanjay,
    When you select New -> Organization, below screen comes, In Grouping drop down you need to select Vendor Account Group and in Role list enter role.
    Follow same procedure when you want to create next vendor.
    Under new pushbutton, you will get three options:
    Organization means when you want to create vendor.
    Person means you are creating person not vendor, these person you can assign as a contact person to the vendor in Relationship tab.
    Regards,
    Sudhir

  • Insert group based on values in array

    Is it possible to do the following:
    formula 1
    currentdate - 9
    formula 2
    currentdate - 2
    create another formula that will store the dates in between formula 1 and formula 2 into an array and then insert a group based on each value in this array?
    Thank you in advance,
    Zack H.

    Yes it is possible but luckily you don't need to engage this difficult (and inefficient method). If you absolutely do need it after reading this post, then give a shout.
    @f_begin
    currentdate - 2
    @f_end
    currentdate - 9
    Then in Select Expert:
    {mytable.myDateOrDateTimeColumn} In In {@f_begin} To {@f_end}
    The create a group by pressing the Group Expert button Click on Options... button and choose "Section will be printed by: for each day". Order as you wish.
    No arrays needed.
    Does this do the trick for you?

  • Managing Application Installs and Uninstalls with AD Groups Tied to Applications

    Hi everyone,
    I'm trying to come up with a way to manage application deployment and removal based on user collections that have corresponding security groups in AD. I'm using SCCM 2012 r2.
    Historically, I've done the following to deploy applications: -
    Create a new application, setting the user experience to install for system.
    Create two device collections, one named install and the other named uninstall.
    Create two application deployments, one to install (targeted at the install device collection) and one to uninstall (targeted at the uninstall device collection).
    Add device to install collection to install application.
    To uninstall the application, remove the device from the install collection and add it to the uninstall collection.
    That has all been working great but moving forward, I'd like to manage deployment based on user collections. So I've approached this as follows: -
    For installations, create a new application setting the user experience to install for user.
    Create a security group in AD that corresponds to the new application.
    Once SCCM synchronizes with AD and the new group appears under SCCM users, create a new user collection making the security group a direct member of the collection. Set the collection to update incrementally.
    Create a required installation deployment for the new application and target it at user collection for the application.
    Add a user object in AD to AD security group for the application.
    Once everything syncs, the user logged on to a workstation gets the application. Up to here, everything works well.
    For uninstalls, I've created an AD security group called Application Uninstalls and made domain users a member.
    Once this synchronizes with SCCM, I've created a new user collection called Application Uninstalls and made the security group a direct member of the collection. Again, the collection is set to incremental update.
    Create an uninstallation deployment for the new application and target it at the 'Application Uninstalls' collection.
    The idea behind the uninstallation is to take advantage of the 'application installation deployments take priority over uninstallation deployments'. Because every user is a member of domain users, if they are not a member of the relevant security group to
    have an application installed, then the application is automatically uninstalled. The trouble is, if I remove a user from the AD security group where they get the application, the uninstall deployment isn't kicking in like I would expect and removing the application.
    Any thoughts? Is this a logical approach or is it flawed?
    Any input appreciated!
    Bazzaroo

    if I'm reading what you are saying correctly, then has the user logged out and then back on? Since the deployment is to the collection based on group membership, the client would not know that the user is no longer a member of the targeted collection until
    the user token has been updated, which happens at log off/log on time.
    It does depend on the collection membership - if the collection membership is to the user group, so that the collection member shows the use group, then the log off/log on would be needed.
    If the collection membership list displays the individual users, then obviously that collection needs to be updated, AND new policy retrieval at the client so that it knows that it is no longer targeted.
    Then, you need an Application Deployment Evaluation Cycle, which is when the client checks to see if apps that are supposed to be installed are.
    Wally Mead

  • In range and coerce with complex numbers?

    I have an array of complex numbers with these numbers I need to set to 0 all numbers whose real parts are negative. With "in range and coerce" I can split the array into real and imaginary then set all negative numbers to 0 then recombine the complex part but that still leaves me with 0+ai numbers that should be 0. How can I also set the complex part to zero for the negative numbers?

    Hello,
    You can use the following fonction in a for loop with your array.
    Michel

  • Service purchase requisition/order with Material group optional

    Is it possible to create a purchase requisition/order with item category D (services) without entering any material group?
    We would like to enter only the G/L account but not the material group.

    Hi,
    It is not possible to create PR/PO without material / Service group & Item catagory D.
    Better create service groups like material group which will help you for reports also.
    Regards,
    Manish Jain

  • SELECT and ORDER with several indexes on a table

    Hi,
    I am looking for the best way to select rows from a table if they satisfy a condition depending on several indexes, or from a join.
    I am currently doing it with unions, like that:
    SELECT article_id, article_date, score(1) score
    FROM articles
    WHERE CONTAINS(article_body,'searchQuery',1) > 0
    UNION
    SELECT article_id, article_date, score(1) score
    FROM articles
    WHERE CONTAINS(article_title,'searchQuery',1) > 0
    UNION
    SELECT article_id, article_date, 100
    FROM articles
    WHERE article_id IN (SELECT article_id FROM article_keywords WHERE keyword = 'searchQuery')
    ORDER BY score DESC, article_date DESC
    But I was wondering whether it would be better performance-wise to do it with conditional expressions like
    SELECT article_id, article_date, score(1) scoreBody, score(2) scoreTitle
    FROM articles
    WHERE
    CONTAINS (article_body,'searchQuery',1) > 0
    OR CONTAINS (article_title,'searchQuery',2) > 0
    OR article_id IN (SELECT article_id FROM article_keywords WHERE keyword = 'searchQuery')
    ORDER BY scoreHeadline DESC, scoreBody DESC, article_date DESC;
    Also, if doing it with conditional expressions, I don't see how to avoir having to declare several "scores".
    In a more general way, I don't see exactly how to consider the results coming from the join with the article_keywords table in terms of score (right now I'm giving them 100, so they're coming up first).
    I am completely new to indexes, so my apologies if anything in this SQL is hurting just looking at it.
    Thanks for reading, and for any help you can bring.

    You can check out the explain plan for the two queries. I did a small test for employees table . The first query scans the table 3 times, while the second does only once.
    hr@XE> EXPLAIN PLAN FOR
      2  SELECT * FROM employees
      3  WHERE last_name like 'Joh%'
      4  UNION
      5  SELECT * FROM employees
      6  WHERE last_name like 'Pet%'
      7  UNION
      8  SELECT * FROM employees
      9  WHERE last_name like 'King%';
    Explained.
    Elapsed: 00:00:03.06
    hr@XE> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 1534505908
    | Id  | Operation                     | Name        | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT              |             |     3 |   204 |     9  (78)| 00:00:01 |
    |   1 |  SORT UNIQUE                  |             |     3 |   204 |     9  (78)| 00:00:01 |
    |   2 |   UNION-ALL                   |             |       |       |            |          |
    |   3 |    TABLE ACCESS BY INDEX ROWID| EMPLOYEES   |     1 |    68 |     2   (0)| 00:00:01 |
    |*  4 |     INDEX RANGE SCAN          | EMP_NAME_IX |     1 |       |     1   (0)| 00:00:01 |
    |   5 |    TABLE ACCESS BY INDEX ROWID| EMPLOYEES   |     1 |    68 |     2   (0)| 00:00:01 |
    |*  6 |     INDEX RANGE SCAN          | EMP_NAME_IX |     1 |       |     1   (0)| 00:00:01 |
    |   7 |    TABLE ACCESS BY INDEX ROWID| EMPLOYEES   |     1 |    68 |     2   (0)| 00:00:01 |
    |*  8 |     INDEX RANGE SCAN          | EMP_NAME_IX |     1 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       4 - access("LAST_NAME" LIKE 'Joh%')
           filter("LAST_NAME" LIKE 'Joh%')
       6 - access("LAST_NAME" LIKE 'Pet%')
           filter("LAST_NAME" LIKE 'Pet%')
       8 - access("LAST_NAME" LIKE 'King%')
           filter("LAST_NAME" LIKE 'King%')
    hr@XE> explain plan for
      2  select * from employees
      3  where last_name like 'Joh%' or last_name like 'Pet%' or last_name like 'King%';
    Explained.
    Elapsed: 00:00:00.01
    hr@XE> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 1445457117
    | Id  | Operation         | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |           |     3 |   204 |     3   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| EMPLOYEES |     3 |   204 |     3   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("LAST_NAME" LIKE 'Joh%' OR "LAST_NAME" LIKE 'Pet%' OR
                  "LAST_NAME" LIKE 'King%')

  • Crosstab Query re Grouping Data into Value Ranges

    Hi
    I am trying to analyse some data in a Crosstab & have a query re grouping.
    The data contains sales transaction info such as selling price, quantity etc. I would like to create a grouping in the Crosstab based on a sale price range (eg £0 - £10, £10 - £20 etc) so that I can show the total quantity sold in each price range.
    To date my method has been to create a formula with Select Case which identifies each transaction into a price range. I would then use this formula in my Crosstab. The main issue with this method is that there will be a large number of Cases & the possibility this will need to be added to / modified going forward.
    Whilst I think this will work I am hoping there is better method to follow?
    Thanks
    Jon

    Hi Jamie,
    Thank you for your help.
    I'm looking to group in increments of 10 so it looks like the Floor function will do the trick, thank you.
    I'll probably use an If statement to do a "block" of prices at either end of the scale (ie < 100 then 100, > 1000 then 1000+ else Floor ({Sales Field},10). Hopefully this way I'll reduce the overall no of rows.
    Thanks again for your help.
    Jon

  • Multi-value parameters and strings with leading zeros

    I have invoice number as a multi-value parameter. Invoice is a string,10 (VBRP.VBELN) .
    Invoice number is my group. If I enter invoices 100 and 200 as parms, then I only get data for invoice #100 (the lowest value entered). But if I enter 100, 0000000100, 200, 0000000200 as parms, then I get data for both invoices. Is there a way to get around having to enter the invoice number in both formats. BTW, if I only enter 0000000100 and 0000000200 then I get no data.
    Selection criteria is (VBRP.VBELN) = ?invoiceno --- parms are defined as allow muliple values and allow discrete values.

    Oops, that's not gonna work with multi-value parameters.  How about:
    if IsNumeric((VBRP.VBELN)) then
      ToText(Val((VBRP.VBELN)), "0") in {?invoiceno}
    else
      (VBRP.VBELN) in {?invoiceno}
    end if
    BTW, the reason why your original formula didn't work was because the "=" should have been "in".  The above is needed only if the (VBRP.VBELN) field might contain leading zeroes.
    HTH,
    Carl

  • Restrict Query Data based on Date range and Users

    Hi All,
    I have a few web reports that I need do restrict data based on Users.
    In all the queries i have an infoobject 0CALDAY, and  a User Entry range variable on it. Because of performance issues  I need to restrict the range of dates a User can see. Typically most of users could go to a max date range of 1 month back. But some others would need the ability to see data for much bigger range of dates.
    Pls suggest how should i go about with this. Should I have to enforce this at Variable level(user exit).... but then i might have to maintain a table for the users.. Is there any other way of doing it.
    thanks
    Raj

    Any thoughts ?

  • How to select certain xml group based on attribute id and return as xmltype

    hi,
    i have an xmltype column name "NM" in table "XMLTEST", the content of the xml in NM is
    <ct>
    <sp id="ALEX">
    <sp id="JOHN">
    <sp id="MIKE">
    <sp id="CALEB"/>
    <sp id="PAUL"/>
    </sp>
    </sp>
    <sp id="MAX">
    <sp id="WAYNE"/>
    </sp>
    <sp id="MAX"/>
    </sp>
    </ct>
    The group i want to select is ALEX except group "MIKE" and "MAX", which return
    <ct>
    <sp id="ALEX">
    <sp id="JOHN"/>
    <sp id="SEAN"/>
    </sp>
    </ct>
    Is it possible? i'm processing this using stored procedure PL/SQL, my environment is 11g R2 Win 32bit.
    please advice,
    wesley

    Hi,
    Not sure where "SEAN" comes from... Typo?
    Try with deleteXML :
    SELECT deleteXML(t.nm, '/ct/sp[@id="ALEX"]//sp[@id="MIKE" or @id="MAX"]')
    FROM xmltest t
    ;

  • ASA5505 and AD with security group

    Hello,
    i have configured ASA5505 with VPN and with AAA from Active Directory. How i can define Security Group? Now everyone from domain can connect to VPN tunnel. But i need specify users in Security Group in AD.
    regards
    Tomas

    Hi Tomas,
    Please see the document /docs/DOC-9361 In this example, you have to replace "radious.25" with "Idap.memberOf"
    Let us know if you have any more questions.
    Thanks,
    Cisco Moderation Team

Maybe you are looking for