Newb question - group by sequence number range

Hi - I'm a newb to pl/sql but am pretty familiar with t-sql and sql server.
Here's my question:
I have a database table with ~1.6M records, call it "a". a has two columns, id (a sequence) and status. status has three possible values: null, error and success.
I want to write a query that will group the sequence numbers into sets of 100k and give the the count of nulls, errors and successes for that set. The output should be something like:
set null error success
1-100,000 x y z
100,001-200,000 x y z
200,001-300,000 x y z
Can anyone point me in the right direction?

I scaled it down with a factor 1000, and here is the idea:
SQL> create table a
  2  as
  3   select level id
  4        , decode(mod(level,3),1,'error',2,'success',null) status
  5     from dual
  6  connect by level <= 1600
  7  /
Tabel is aangemaakt.
SQL> select trunc((id-1)/100)*100 + 1 lb
  2       , trunc((id-1)/100)*100 + 100 ub
  3       , count(decode(status,'error',1)) err
  4       , count(decode(status,'success',1)) success
  5       , count(decode(status,null,1)) "NULL"
  6    from a
  7   group by trunc((id-1)/100)
  8  /
        LB         UB        ERR    SUCCESS       NULL
         1        100         34         33         33
       101        200         33         34         33
       201        300         33         33         34
       301        400         34         33         33
       401        500         33         34         33
       501        600         33         33         34
       601        700         34         33         33
       701        800         33         34         33
       801        900         33         33         34
       901       1000         34         33         33
      1001       1100         33         34         33
      1101       1200         33         33         34
      1201       1300         34         33         33
      1301       1400         33         34         33
      1401       1500         33         33         34
      1501       1600         34         33         33
16 rijen zijn geselecteerd.Regards,
Rob.

Similar Messages

  • Question: How to assign number ranges to the Official Excise Document Numbe

    Question: How to assign number ranges to the Official Excise Document Number
    Field name is: EXNUM, table name: J_1IEXCHDR
    SAP CIN
    Dear expert,
    I will briefly explain the scenario:
    I have created return po.
    Process MIGO w.r.t. return PO- Material document generated.
    Process: J1IS - excise invoice other movement create.
    --> Now I want to print the document --> I m trying with T-code J1IP --> entered all the required data --. Used out put type - J1I0
    But I am not getting the list of document for printing and even print is not coming.
    There is no print document getting for a printing.
    When I checked in an above said table (mentioned in question), I found that for transaction type OTHR, there is no number ranges defined for official document no.
    And because of this reason I m not getting any document in the print.
    Can you Pl extend Ur help and Pl suggest me where (path or transaction) the number ranges can be maintained for the official excise document No.
    Thanking you all n advance and expecting your earliest response.
    Regards
    om

    Dear Friend,
    J_1IEXCHDR this table stores the all the excise documents created while excise transactions are done ,
    for that Goto j1i9 or SNRO  in these transaction you maintiane the number ranges  for the
    J_1IPLA2     PLA part II number range object
    J_1IRG1     RG1 Number range object
    J_1IRG1_T     No. Range for RG1 - Excise group / Material
    J_1IRG23A1     RG23A part 1 no. range object
    J_1IRG23A2     RG23A part II number range object
    J_1IRG23C1     RG23C part I number range object
    J_1IRG23C2     RG23C part II number range object
    J_1IRG23D     Folio Numbers for RG 23D
    like these  lot of objects are there  for them u maintiane the no. ranges
    Regards
    Pramod

  • Account group with Internal Number Range

    Hello Gurus,
    With Internal number range assignment to the Customer Account Group, I am unable to extend the customer from one sales area to another sales area with the same Customer number.
    If I am not it is a standard feature that irrespective of the number range (internal or external), with the same customer number, customer can be extended to multiple sales area.
    Please correct me if I am wrong and suggest a solution.
    Thanks in Advance

    Hello friends,
    No error message but the next number is getting allocated.
    in VD01 or XD01
    the following steps r followed.
    1. Enter the Account Group
    2. Sales Area (New Sales Area for the customer)
    3. Reference Customer.
    4. Reference Sales Area.
    Rather than going to the sales area directly, General area screens are appearing.
    Upon saving saving the details New customer number is getting allocated.
    I have no clue where I have gone wrong...
    looking forward for suggestions.
    Regards

  • Excise Group Problm in Number Range

    Hi All,
       I have Created One Excise Group And assigned to One no range. But it is not showing in number range creation ( In SNUM ). My no range object is j_1irg23a1. So pls send your valuable answer......
    Thanks And Regards
    Pradip Pawar

    Hi Vishal,
    Full marks to you! Congrats!!
    Unfortunatly I am not finding option to reward points, if you please tell me, I will do it for you. OK?
    Only thing is that the table name is J_1INEXCGRP and not J_1INSRGRPS
    My job is working perfect, I think yesterday you was not there, before Pradip I posted the same problem.
    -Saleel

  • Urgent: Solaris newbie question: group permissions etc

    Hi
    I have a question on what is the best practice of working with solaris users and permissions. I'm using Solaris 10 and have created several users each with their home directory in /export/home. Then i have installed the sun webserver under /export/home/sun/webserver and i want all users to be able to use this, execute or copy over to the webserver.. would this be a valid solution or good practice solution tht i crete a group give it the permissions to read/write/execute and all the users i want to give this privilege to will be under this group. but then whats the use of having root like how would root user be different from the rest now...
    thanks...

    If you just want them to be able to publish to the web, apache has a little built in script in the httpd.conf that will hook in a user directory. Read the /etc/apache/httpd.conf file for more info.
    Whether this is best practice I am not sure. What you suggest will work but I would avoid it.

  • Urgent : Unable to maintain the Number ranges for Excise Groups

    Hi CIN experts............
    In Development server I created 3 excise Groups (E2,E3 and E4), the same I was transported to Production.
    J_1IRG23A1, J_1IRG23A2 object number ranges are Excise Group specific.
    When I go to Tools - Number Ranges to maintain number range for J_1IRG23A1, J_1IRG23A2 objects I didn't find these excise groups.
    Im able to see these Excise groups in Tools - Number ranges in Development server, but not in Production.
    Can any one guide me something to resolving the issue ?
    regards
    Durga Ram

    Hello Nagaraju,
    Can you please tell me the customozing path for maintaining the number ranges for PM log entries.
    I require to mention customizing path in my document.
    Puneet

  • Vendor Number Range relation with account group.

    Dear All,
    I have one more doubt. Kindly clarify.
    I know that account group and vendor number range and linked with each other. Number range can be assigned to one or many account groups. Let's consider a case where 3 Account groups (assume X,Y & Z) have one common number range. When we create a vendor, in an account group (for example, X) vendor code assigned internally is 100000.
    Subsequently if we create another vendor in the account group Y, will the vendor code assigned intenally be, "100001", considering intervals to be of 1 or any other number falling in the number range assigned to this account group?
    Does there lie any rule or method which assign the code in this manner or any other...?
    EnjoySAP,
    Thanks

    Hi,
    When a vendor master record is created, a unique number identifying the master record is assigned. The number comes from the number range provided for the account group.
    Internal number assignment
    Here the SAP R/3 System automatically assigns a consecutive number from the number range defined, irrespective of any number of account groups attached to which the number range has been assigned.

  • Order number range - Group

    Hi,
    Client requirement is to maintain different number ranges for each order type.
    Whenever I try to create a Group(Menu-Group-Insert). Then Text. Then number range.
    I created new group, text,assigned number range but the new group is not coming.
    (system is not throwing any warning/error message regarding overlapping)
    Kindly share your views where i'm going wrong.
    Thanks
    Prasad

    Hi ,
    Whenever we add new group it comes at the bottom ie before Not assigned.
    But it's not coming(the new group).
    It's coming in Sandbox client but not in Testing client.
    Kindly share your views.I'm under pressure from Client....
    Pete & Thyaga...waiting for your views
    Prasad

  • Vendor acct group and number range in the MDC vs MDS

    IN MDM 3.0 when a new BP with vendor as role is created via UI in MDS the vendor is created with a generic BP number range in the MDS.  The down stream MDC's all have different vendor account groups with different number ranges assigned in each MDC..  example...
    client     type of vend   acct grp      num range
    MDC1      purch vendor     com2      1000000-1999999
    MDC1      acct vendor      act1      2000000-2999999
    MDC2      purch vendor     pur1      2400000-2499999
    MDC3      purch vendor     POV1      3599999-3599999
    How does MDS know when it distributes the vendor to the MDC's what account group and number range to create the vendor with in the MDC's.  The MDC cannot change all its existing master data that has been created already with the account groups and number ranges becuase field variants have been established.  Where is this mapping contained MDS or XI and how is it done.

    The number range in the MDS is determined by the value in the "Grouping" combo-box.  This combo-box is populated by values entered in IMG activity Master Data Objects -> Business Partner -> Business Partner -> Basic Settings -> Number Ranges and Groupings -> Define Groupings and Assign Number Ranges.  Each value must have an associated number range and one of the values must be defined as the standard grouping in case the user doesn't select a grouping.  This is how numbering occurs in the MDS.  Unfortunately you cannot assign more that one grouping to a new BP.
    Now, for the MDCs.  When sending a new BP to an MDC, for example an R/3, there must be an external number range setup in the MDS for that MDC and it shouldn't conflict with any number range in that MDC. 
    IMG Activity Master Data Exchange -> Central Settings -> ID Mapping -> Make General Settings for ID Mapping allows you to define which number range you want to use for a specific object type in a specific system (e.g. KNA1 (customer) in system R/3_100). 
    So far this isn't sufficient for you because you have 2 number ranges for MDC1 in your example. 
    In the IMG activity I just mentionned, there is also a possibility to add an additional parameter which allows you to assign a number range for each unique object-type/system/additional parameter combination.  By putting the account group in the additional parameter field, this allows you to assign number ranges per account group.
    What remains to be done is to use this information in the XI Mapping for BP to R/3 Vendor.  The first thing is for the XI Mapping to map the MDS account group to the MDC account group.  Then the XI Mapping must call the MDS to create a new ID-Mapping between the BP and the Vendor.  During this call, the XI Mapping must provide all the usual parameters as well as the account group.  This will ensure that the correct number range will be selected so the correct vendor id will be generated.  This id will then be used in the ID Mapping.
    If you need to create the Vendor for multiple account groups, then you will have to implement special logic to map the MDS account group from the BP to the many MDC account groups needed for the Vendor.
    Hope this helps!

  • Maintain Number range group for Internal order

    Hello,
    I have created Internal order type, now, i would like to create/maintain the number range group for this already created order type.
    When i goto Maint Number ranges for orders->click on Group->Maint and again click on group insert... when i mention here the group name and number range for that group and say save the system in accepting but when view all the groups, i do not find this new group created by me.
    How do i view the newly created group, is there any other steps to be followed? please advice.
    regards,
    radhakrishna

    Hi:
    It's a little late for this post but it is still important to record.
    When you try to create a group in KONK transaction, the system doesn't show the new group.
    This is because there are a inconsistences in the old groups.
    You must execute RSSNR0T1 program to solve the problem.
    Greetings
    Marco

  • Internal number range for SP

    Hi All,
    Please help to find out why system does not assign continuous running number for new sold-to-party account group.Why Internal number range of sold-to-party assigned by system not in running sequence.
    Thanks & Regards,
    Pallavi

    Hi pallavi
    Go to OVT0 and select the sold to party account grp and and in that details you can see the number range field ,there you can check what number range has been assigned to the account group. Another way is go to OBD2 and check the sold to party account grp which number range has been assigned
    Regards
    Srinath

  • Alphanumeric number range of Rebate agreements

    Hi,
    Question on using u2018Alphanumericu2019 number range of Rebate agreements. We would like to use alphanumeric number range for our rebate agreements so that we can build certain logic such as year\customer\type for easy reporting & grouping. For instance first digits for year, next 3 digits for customer code and so on. We are using SAP 4.7.
    Question - Are there any disadvantages of using alphanumeric number range for Rebate agreements. Does it cause any performance issues. I hope it is not. What we read & noticed that Rebate related transactions & reports are performance intensive.   Hence I would like to double check with forum if anyone using alphanumeric number range for Rebate agreements & any issues encountered.
    Any feedback on above would be really appreciated.
    thanks
    Sunil

    Hi,
    I dont think there will be any impact on performance if you use an alphanumeric number range instead of a number. Anyhow,  you have to use a number range. You are only enabling this by coding(may be) instead of just configuration.
    The only thing you have to remember is that there should not be any buffering issue in number range. Otherwise your own number range (alphanumeral) will work as good as any other number range.

  • Number range for service desk

    hello,
    i have some questions regarding number ranges:
    which are the default number ranges groups?
    what number range should i use for service desk?
    thx

    Hi Galan,
    I'd post the answer but the forum nanny is saying I have posted forbidden words and phrases. Even though it was just a frew quick sentences.
    Forum Admins, can we get this thing removed? It's annoying and bever tells you what is flagged.
    Jason

  • Excise invoice number range wants to be same for domestic & export & Deemed

    Hi Gurus,
    My Client wants one excise number range for all sales transactions,
    including domestic & export & deemed export,
    I tried to manitain only one number ranges in Local number range object only to utilise
    that check box of local number range in excise invoice screen,
    but still it is not allowing us to do so ,
    I tried to maintain  number range for export serious group in local number range object only but still it is not allowing me to do further proceed for ARE-1 with refernce of that excise invoice number ,
    please give me solution for this issue ,
    we are in very bad situation our Go-Live is stuck due to this issue from 1 week,
    Regards,
    Sai

    Do not maintain Numbers for the Object: J_1IEXCEXP; only maintain for J_1IEXCLOC
    When you go into J1IIN, you will need to mark the checkbox: Use Local Number.  If at the first time (in the case of Deemed and Regular Exports), you do not see this checkbox, click on the 'Calculator'  icon and hit the 'Back' icon. Mark the checkbox and save your Excise Invoice. This number will be a continuation of your Domestic Excise Invoice.
    thanks
    G. Lakshmipathi

  • How to change number range in solution manager

    Hi all,
    Recently we had upgrade of ST patch, after that our support message sequence got changed and now support messages are getting created starting from 1. We want to change the sequence(number range).
    how/where can i change the sequence of the support messages(number ranges).
    Thanks & Regards
    Nick Loy

    Hi Prakar,
    Thanks but as you told above, i am not able to change the number range 01 to 02 in SNRO.
    System is not allowing me to chagne the existing one.
    now my system has the details as below:in SNRO>>>>CRM_SERVIC>>>>
    01     0000000001     0000999999     780
    02     9999000000     9999999999     0         External
    I want to change the message sequence starting from 9999000001 which is in extenal number range.
    And one more thing, where can i find the number range which is being used for particular transaction?
    can you help me how to change?
    Thanks & regards
    Nick Loy

Maybe you are looking for

  • Problem with Intro to IDVD Help!!!

    I have created an IDVD form Iphoto pictures are great music is good and when I preview its fine. When I burn it and put into the DVD player the last picture of the slide shows up and then right after the intro appears. what am I doing wrong? Help nee

  • What can I do if I microwave my iPhone?

    I made the idiotic decision of microwaving my iPhone 5 - only for four seconds, but nonetheless it has caused my phone to lose its wifi and phone service... it only shows "No Service" in the top left corner and I don't know what to do. I feel like a

  • Email logs in case of exception

    I want to configure "Application Server Control Console" of Oracle Application Server to send an email incase there is an exception ...can you please tell me how to do that...or point me to the documention to do that. Thanks

  • IPhoto compatible with mac os X 10.8.5? Thanks

    Hello, I am trying to buy iphoto compatible with my OS X 10.8.5 but apple store tells me it cannot install it since I haven t got an 10.9 system. Could you please tell me how which version of iphoto do I need and how to buy it? Thanks

  • HTTP POST Is VPN required?

    Hi experts!! I am trying to post some parameters to a url (an external website). I am getting a response 404-Not found. I have checked with the developers of the website and they are asking me if a VPN is set up between SAP server and their server. I