How to create rownum or auto number

Hi All,
I got some problem in create rownum or auto number in following table condition.
eg.
MeasID PosID Desc
==== ====== ===
P01 1 Abc
P01 1 Cde
P01 2 Abc
P01 2 Efg
P01 2 Xyz
in select statement, I would like to make it look like:
Num MeasID PosID Desc
=== ==== ====== ===
1 P01 1 Abc
2 P01 1 Cde
1 P01 2 Abc
2 P01 2 Efg
3 P01 2 Xyz
How can I create a running number and make like some short like group by PosID?

Use analytic row_number:
with t as (
           select 'P01' MeasID,'1' PosID,'Abc' Descr from dual union all
           select 'P01','1','Cde' from dual union all
           select 'P01','2','Abc' from dual union all
           select 'P01','2','Efg' from dual union all
           select 'P01','2','Xyz' from dual
select  row_number() over(partition by MeasID,PosID order by Descr) num,
        MeasID,
        PosID,
        Descr
  from  t
  order by MeasID,
           PosID,
           Descr
       NUM MEA P DES
         1 P01 1 Abc
         2 P01 1 Cde
         1 P01 2 Abc
         2 P01 2 Efg
         3 P01 2 Xyz
SQL> SY.

Similar Messages

  • How to create a transport request number in SM36

    Hello SAP gurus,
    Can someone please let me know, how to create a transport request number while schedule a new job in SAP.
    Can we create a new transport request number in SM36?
    Thanks
    Sha

    Hi Sha
    Doesn't make sense to create Transport number in SM36, where it meant for scheduling the batch jobs.
    I would rather suggest you to create in SE09 -> Creaet  (F6) or
    while doing the config ->save the config-> create new req
    Please voice out if you really have other requirement to have this.
    regards
    RG

  • How to Create an Custom Employee Number Generation ...

    Dear Friends,
    We are Implementing HRMS Suite Version12i, for one of the Client in Middle east.
    One question about Custom Person Numbering.
    How to create custom employee numbering Based on the User Person Type?
    Example:
    Two person types
    o Permanent Employee
    o Probationary employees
    We Need to give two different numbering schemes for each person type.
    eg Permanent Employee will use a seq begin 100000 whereas Probationary employees (other user type) will use a sequence beginning 200000.. Can any pls let me know how to handle the Custom Employee Number Generation (with Setups)
    With regards
    Swpana

    Hi,
    Could you please help me to write/or send a sample of a Person Number Generation Formula.
    I don't see the noteid : 279458.1 on metalink,I get the following message:
    Article or Bug cannot be displayed. Possible reasons are:
    The article Id or bug number was entered incorrectly. Please check and try again.
    The article Id or bug number does not exist (was referenced incorrectly).
    The article or bug is not classified as publicly accessible ("non-public").
    The content is being updated and it is temporarily unavailable but will be made available again soon.
    If you still have questions about why you could not access this article or bug, please use Feedback.
    Please help!!

  • How to create a validation on number field.

    Hello Experts,
    My database table has a numeric column EMP_ID. I want to create a validation so that a user can only enter numeric value in this field on the Apex page.
    I have tried to create validation Item/Column specified is numeric for item P2_EMP_ID.
    But when I submit the page, I still get the error ORA-01722: invalid number.
    How can I create a validation so that the ORA error is hidden from the end user and instead a custom message is displayed.
    Thanks,
    Rahul

    Rah,
    Are you on 4.0? This functionality already exists inside of apex. In fact, thats the only difference between the number field and the textfield. Once you create a "Number Field" it automatically creates a numerical validation (but you have no access to it). Likewise for setting the "Require Value" setting on a textfield; the creation of a NOT NULL validation that you can not directly manipulate.
    If you are not on 3.2 maybe you can use javascript to restrict the user from entering anything but numerical inputs.
    Alternatively, (not sure of 3.2 support) you can install the MASKED INPUT PLUGIN, and make the mask "?9999999999999" (everything after ? is optional and 9 means only numerical)

  • How to create a column auto increment

    I want create a table with one column can
    auto increase after insert each row, but I
    don't know how to?
    Thanks.

    Oracle doesn't have a native auto-increment field like some databases, so you need to code one using a sequence. I've had good success using a trigger on my table like the following:
    CREATE OR REPLACE TRIGGER SAMPLE_TRIGGER BEFORE
    INSERT ON SAMPLE_TABLE FOR EACH ROW begin
         if ( :new.TEAM_KEY is null ) then
              select "SAMPLE_sequence".nextval into :new.TEAM_KEY from dual;
         end if;
    end;

  • How to create an item Phone Number of US Format

    Hi,
    Need to create an item in a page Phone Number.
    The Item should accept only US Phone Number Format.
    Need Suggestions.
    Regards,
    Krishna

    Hi Krishna,
    You can make the US Phone format validation in the Page controller by making a validation function and call this validation function on the submit button or form submission. u can use the following function in the page controller-
    public void validatePhone(String sPhoneNumber )
    Pattern pattern = Pattern.compile("\\d{3}-\\d{3}-\\d{4}");
    Matcher matcher = pattern.matcher(sPhoneNumber);
    if (matcher.matches()) {
    throw new OAException("Phone Number Valid", OAException.INFORMATION);
    else
    throw new OAException("Phone Number must be in the form XXX-XXX-XXXX", OAException.INFORMATION);
    and call the validation function in processFormRequest function
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAMessageTextInputBean msgInBean =(OAMessageTextInputBean)webBean.findIndexedChildRecursive("<id of the element>");
    if ((pageContext.getParameter("<submit button>") != null))
    String val =(String)msgInBean.getValue(pageContext);
    validatePhone(val);
    u also have the following imports in the controller -
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    I hope this will help u.
    Regards
    Renu

  • How to create the automatic serial Number through DIAPI

    Dear All,
          i Tried to do the Inventory Transaction through DIAPI with Automatic Serial Number creation ,its working fine but i have problem when i  choose another warehouse.Let me give an Example i have three ware house called W01,W02,W03 for the first ware house W01 i can  automatically create the serail from 1 to 100, the moment when i choose the second ware house (i.e.,) W02 my serial number should start from 1..  any one can help me this regards
    Thanks in advance
    G.shankar Ganesh

    Dear G.shankar Ganesh,
    The serial number is unique in all warehouse in B1 system. It means if one item has serial number '1', then
    you can not add the serial number '1' for all warehouse.
    The DIAPI implements same logic as B1 application so it can not implement in DIAPI also.
    Best Regards
    Jane Jing

  • How to create DVD which auto-plays video (no menu)

    Subject pretty much says it all. Is it possible to create a DVD which simply plays a video without a menu (preferably looping the video)?

    Yes. After adding the slideshow to the iDVD project go to the Map mode and drag the video into the left hand bin "Drag content here to automatically play when the disk is inserted". With that slideshow selected go to the Advanced menu and select the Loop slideshow option.
    OT

  • How to create quickly a large number of UI Elements on a view ?

    Hi Folks,
    my task is to create several views with many many fields.
    Is there an other way than clicking them field per field in se80??
    i.e. Inserting rows in tables WDY_UI_ELEMENT* or something - maybe a FM
    Thanks in advance
    Michael

    >i.e. Inserting rows in tables WDY_UI_ELEMENT* or something - maybe a FM
    This is absolutely, 100% NOT supported by SAP.  There are no public APIs for creation of Web Dynpro Component development objects.
    As suggested, the container form wizard is generally what people use to speed the process.  You put in a framework of containers and then run the form wizard on each container to quickly generate the inner UI elements.

  • How can we create a work schedule number

    Dear pp masters
    i have one issue in our client side, we are in repetitive manufacturing(with mrp),how to create the work schedule number,,,, ,in that we have see only semifinished not finished,what is the t-code pls reply back
    thanks in adavance
    devendra

    Hi,
    Please check the below link ;
    http://www.sap-img.com/production/commonly-used-tcodes-in-pp-module-part-1.htm
    Regards
    Sreedhar reddy

  • Webform that opens with auto number

    I need a web form that opens with a 5 digit number auto assigned. Each new form will increase by one  digit. When submitted it sends to mysql db. All connections between form and mysql have been made and are working. Just have not  figured out how to open form with auto number. Any help would be appreciated.

    The problem with your plan is that everytime a user, spambot or any other person or bot opens your form, a number gets generated. This might be an argument for generating the number outside the database, using even a simple text file to store the numbers as they accumulate.The alternative would be to use  an auto_increment primary key in the database to generate the number. The problem with that approach is that your database will fill up with empty records that contain just the primary key.
    I think that the best solution is to simply not do what you are trying to do. I think it's a bad plan.
    If you were to use the database method, as soon as the page opens, run an insert query on the database to simply generate the number, then call the number from the database using either:
    id = mysql_insert_id(); ----with the original, bad mysql connection
    $dbh->lastInsertId()  ----with a PDO connection
    Then, after the form is filled out, use an update query with a where clause as so:
    update mytable set name = '$name'  (etc., etc.) WHERE id = '$id'
    As already pointed out, using this method, your table will populate with many rows that contain just the key number because many users and spambots that open the form will not complete it, or your validation will reject them, but you could run a trigger on your database to purge these empty records automatically, or, if you don't know how to create a trgger, you can run a query that simply says:
    DELETE from mytable WHERE somefield IS NULL AND timestamp > currenttime + 5 hours
    (the above the the query logic, not the actual finished query. You wouldn't want to delete all empty records because you may delete some where the user is still filling out the form, that's why you would give it a few hours between creation time and delete time.)
    So if you used the text file method, you would use the PHP fopen function to open the file, check for the last created number, add the next number to the list, and echo that number on your form. You would run this script at the top of your page.
    But I would really think hard about whether you really need to generate the number before the filled out form is submitted. Maybe you do, but avoid it if you can.

  • How do I create and header on the left and auto number pages on the top right? I can't rearrange my document by making page 10 page 5 and so forth

    I've just completed my school report however I seem to be having difficulty with creating a header. I've managed to create the header for all pages in my document by however I also need to use APA style and insert page number on the top right hand corner of each page. I've chosen to auto number them and clicked on INSERT --AuTO PAGE NUMBERS however if I need to make changes to the page numbers, each change i make repeats on every page. Please help.
    I also can't seem to rearrange my document. It's 10 pages long and i want to make page 10 page 1. I thought I could click on that page and drag it into page 1 position like in Keynote however it's not offering me that option. when i click on page 10 in my page thumbnails, all of my pages are highlighted yellow instead of that 1 particular page. what am I doing wrong? someone please help

    You can chose to make left and right headers different in:
    Inspector > Layout > Section
    To move material the best solution is always to copy and paste the content where you want it. You can move sections however so:
    click at end of page 9 > Menu > Insert > Section Break
    You will then have a separate yellow border around the page 10 thumbnail and can drag it to the beginning.
    Peter

  • How to Create Business Partner with  fix number in t-code :BP

    Dear SIr,
    Normally I will set number range for auto  to create Business Partner. In case , If we would like to crea How to Create Business Partner with  fix number in t-code :BP , howe to do?
    Please kindly advise.
    THnak you and best regards,
    Vimol

    Dear Shobhit,
    How to put the thread as you mentioned.
    Best regards,

  • Custom themes: How do I create & edit an auto-text box?

    Hello
    Continuing my exploration of custom themes
    I have now found out how to make text boxes editable (control-command-option-T, that was carefully hidden!) and am now struggling with creating and editing 'auto text' boxes (not sure what their real name is in Keynote-speak)
    1) Creating new text boxes:
    Let's take a simple theme like White. One of the Masters is Title + Bullets Left. Now let's assume I want to create two text boxes with bulllets - the existing on the left and another on the right. In PowerPoint it's pretty simple: highly text box; copy; paste; move & resize as needed. Well Keynote won't let me Copy so that's out. If I create a fresh Text box, I can mimick the indent levels, bullets, font attributes, etc. (long and painful) but it still won't work because it is not a placeholder text box (fixed size) but a regular text box (size depends on content).
    I'm sure I'm missing a trick!
    2) Edit auto-text boxes
    Again, take any theme, say White again; If I choose a Master with a set text placement, say Photo Vertical, there is very little I can do with it: I can change text attributes and box size, but I can't touch the number of indentation levels for example. Then again what defines a text box as been 'double click here to edit' from a regular placeholder?
    Overall I think I'm missing a whole editing 'avenue' regarding masters - Anyone care to guide me?
    Thanks!
    Message was edited by: Moscool - typos!

    You can set a text field to be multi-line and tick off the option to scroll
    long text to have it automatically wrap, but you'll have a problem with the
    first partial line, since form fields can only be rectangular. Another
    problem might be the lines themselves, since you'll have to use a font size
    that will fit them exactly, or it will look odd. I would suggest getting
    rid of those lines altogether. They are not needed when filling in the form
    electronically. It's a relic from printed out forms where people had to
    hand-write their answers.

  • How to auto number existing chapters?

    I have chapters and a TOC already created in Pages.  Some of the chapter titles were copy/paste so that they have the same chapter number (but I changed the chapter sub head).  My TOC looks like this:
    Chapter 1      4
    xxx
    Chapter 2      15
    xxx
    Chapter 2      24
    xxx
    Chapter 2       37
    xxx
    I did go into Inspector > Text > List > Numbers but that ends up looking like this:
    1. Chapter 1      4
    xxx
    2. Chapter 2      15
    xxx
    3. Chapter 2      24
    xxx
    4. Chapter 2       37
    xxx
    Is there a way to get the auto number in front of the word "Chapter"?
    Also, will this update the chapter numbers inside the document?

    Ok.
    While you're here, how do I make my TOC titles clickable?  Seems like this was working earlier but not they don't bring me to the title within the document.

Maybe you are looking for

  • Problem of editing in BC with a Muse site

    I published a web site for a client in Business catalyst. The site is create with Muse. We can edit the site and all the elment in business catalyst but when we want to publish we have this message "Erreur Error occured while saving the page.". It is

  • IE 9 incorrectly encoding Unicode characters in URIs to ISO-8859-1 instead of UTF8

    Lets take the example word präsentation In Firefox, if I specify that as a CGI parameter, on the receiving end, I recieve: pr\\303\\244sentation which decoded as UTF-8 gives me: pr{U+00E4}sentation or my submitted word präsentation. What does IE give

  • Mac book pro to vga

    I recently purchased a MAc Book Pro and a Min-dvi to VGA to connect to an external monitor only to find it doesn't fit, am I correct in assuming I need a Mini display to VGA?

  • Problems connecting to WRT54GS

    Hi, i have a Linksys WRT54GS router and im having trouble connecting to it by both wired and wirelessly. i can connect to it in a way but it doesn't assign an IP address and comes with the message "Limited or No Connection" also the DMZ light isnt li

  • HD- DVDS and apple DVD player

    Hey guys, I saw some threads on here saying that the macbook cannot play HD-dvds but I am a little confused as to why the apple dvd players have HD settings. Any thoughts would be fantastic. Hope y'all are doing great!