Get the Maximum number

I have a problem

I have INV_REG table where assets are stored

and here the genereates inventory number (corresponding inv_no) like this:

ABC-025145-2009

DONORS-SRNO-YEAR


now, I want to get maximum number of series that will come from donors. I draw the following question, but I can not guide kindly maximum number me...


Select corresponding inv_no, substr (inv_no, instr(inv_no,'-') + 1, instr(inv_no,'-')-1) sr_no
of inv_reg
where don_code =: don_code;


result:
---------
SR_NO INV_NO CORRESPONDENT
AC-AD2-0272-2003 HD
ABC-9428-2006 9428
ABC-9426-2006 9426

I use oracle 9i database...

Should always be the first line in a post ;)

Yet once, assuming no revenue for DONORS:

SQL> with t as (
  select 'AC-HDIT-0272-2003' inv_no from dual union all
  select 'ABC-9428-2006' from dual union all
  select 'ABC-9426-2006' from dual
)
--
--
select inv_no, trim ('-' from rtrim (replace (inv_no, rtrim (inv_no, '0123456789-')), '0123456789')) ser_no
  from t
/
INV_NO                    SER_NO
------------------------- -------------------------
AC-HDIT-0272-2003         0272
ABC-9428-2006             9428
ABC-9426-2006             9426                     

3 rows selected.

Tags: Database

Similar Questions

  • How to get the maximum number of days in a month?

    How to get the maximum number of days in a month?

    I use a dateField. where I can get the month. Now, I want to get the maximum number of days in a month.

    How can I get it?

    Please help me. and thanks in advance... []

    NET. RIM. Device.API.util
    Class DateTimeUtilities

    getNumberOfDaysInMonth (int month, int year)
    Returns the number of days in the specified month

    It took me like 10 seconds to find it in the API, I guess you spent more time writing the post...

  • How to get the maximum number of iterations in the property of TS

    I was put the loopType from one step to the count of success/failure. For example "stop after 1 iterations pass or a maximum of 3 iterations. The maximum iteration is 3. What my qustion is how to get the maximum iteration of TS property by codes of trial during the race. Thank you very much!

    Corey Chen

    The OPPO test developer

    Hello

    It may be a hack, but RunState.Step.LoopWhileExpression has information.  It will return a string like: "RunState.LoopIndex."< 69="" &&="" runstate.loopnumpassed=""><>

  • get the maximum number for each group

    Hi, I am a newbie and work on a project for school. I worked this problem for a few days and made a bit of progress.
    I have two tables, student and register for a database of the College. I need to show students that have the most entries into each large. So far, I have:

    WITH COUNT_Q AS
    (
    SELECT B.SSN, B.MAJOR, COUNT (A.CLASS_NO) AS COUNTCLASS
    TO REGISTER A, STUDENT B
    WHERE A.SSN = B.SSN
    B.SSN GROUP, B.MAJOR
    )

    SELECT MAX (COUNTCLASS), MAJOR
    OF COUNT_Q
    GROUP BY MAJOR
    ;

    I get the correct results, but need to introduce the SSN and the Major of the studens. When I add in the SSN and major, as below, I get too many files.
    WITH COUNT_Q AS
    (
    SELECT B.NAME, B.SSN, B.MAJOR, COUNT (A.SSN) AS COUNTCLASS
    TO REGISTER A, STUDENT B
    WHERE A.SSN = B.SSN
    B.NAME, B.SSN, B.MAJOR GROUP
    )

    SELECT *.
    OF COUNT_Q
    WHERE (COUNTCLASS) IN (SELECT MAX (COUNTCLASS)
    OF COUNT_Q
    GROUP BY MAJOR
    )
    ;

    Can someone point me in the right direction?
    SELECT  B.NAME,
            B.SSN,
            B.MAJOR
      FROM  (
             SELECT  B.NAME,
                     B.SSN,
                     B.MAJOR,
                     COUNT(A.CLASS_NO) SSN_MAJOR_COUNTCLASS
                     DENSE_RANK() OVER(PARTITION BY MAJOR ORDER BY COUNT(A.CLASS_NO) DESC) RNK
               FROM  ENROLL A,
                     STUDENT B
               WHERE A.SSN = B.SSN
               GROUP BY B.NAME,
                        B.SSN,
                        B.MAJOR
            )
      WHERE RNK = 1
    /
    

    SY.

    Published by: Solomon Yakobson, March 27, 2011 18:53

  • Get a Virus message "the maximum number of secrets that may be stored in a single system has been exceeded.

    How to remove "the maximum number of secrets that may be stored in a single system has been exceeded?

    Download and run malwarebytes... see if that helps

    www.Malwarebytes.org

  • Get the maximum index of a vector of growth

    Hello

    I'm having a very strange problem. I simulate data with an sine function in a while loop and I keep the values< 0.7="" into="" a="" vector.="" when="" the="" sinus="" values="" are="" over="" 0.7,="" i="" remove="" the="" vector.="">

    I would like to get the maximum index of the vector at each iteration of the loop. However, I get a zero index while the vector has a size > 0.

    It's really strange, because if I put the values of the iteration instead of the values of the sine, the index created is correct (the only difference is that the iteration number is an integer, while the sine is a decimal number).

    To make someone understand something?

    Thanks for your help

    Andrew

    Instead of "delete table", just leave the REAL empty case and 'use default if unwired' on the output of the table tunnel.

    Once the sinuses is once again<0.7, you="" are="" on="" the="" descending="" branch,="" so="" the="" first="" element="" is="" always="" the="" largest="" for="" a="" while.="" nothing="" wrong="" with="">

    I would also put indicators after the case structure so they update in all conditions.

    Table min & Max will give you the index of the element with the highest value. If you want to know the size of the array, use the function "size of array".

  • Sharing the maximum number of folders in windows server 2012

    Hello

    What is the maximum number of shares that can be set in windows server 2012 (or windows server R2 2012)?
    Is there a limit to the number of shares?
    This default can be changed (increased)? If so, how?

    Thank you
    Limor

    This issue is beyond the scope of this site (for consumers) and to be sure, you get the best (and fastest) reply, we have to ask either on Technet (for IT Pro) or MSDN (for developers)
    *
  • Error already have the maximum number of partitions, impossible to reclaim the unallocated disk space

    Original title: recovery disk unallocated space - please help

    I bought a lenovo z370 and it came with a partition of a disk c with 653 GB NTFS and d lenovo 30 GB drive and two other drives without names like d or e simply unamed with 200 MB of space and another with 14 GB of space... now to partition C drive more far I used the shrink option and shrunk 200 GB which now shows as unallocated space and when I try to create a new volume on it it says I already have the maximum number of partitions... What do I do now? How to restore this 200 GB of unallocated in my c drive space or do in another player... Please please help

    And see if I've followed the process this last link of how to re-partition my drive is what I did in the first place and because I got 4 partitions as I detailed it in the other answer, I have written that if I reduce my c drive, it becomes unallocated space, and even with the new volume Wizard does not become a player since I get an error message have already 4 partitions...

  • Facing the question with the Maximum number of connections Timesten

    Hello

    In my project, I need to increase the maximum number of connections that timesten offers me. So, I changed the setting of the nucleus as shown below in the file/etc/sysctl.conf.

    kernel.SEM = 655 670720 128 1024

    The intention here is to get 500 connections max. But even after this setting too, I get only 477 connections. I don't understand why this is happening. Someone help me understand what is happening here.

    In above configuration, my hypothesis is that 155 semaphores are reserved for internal use of timesten and remaining 500 will be available for me, but this isn't the case. Please, help me in this aspect to understand why I get only 477 connections instead of 500 connections.

    Quick help is very appreciated

    Thank you

    Agnes

    Hi Agnes,.

    Thanks for the release of ttStatus. He explains what is happening and confirms my suspicions (second).

    The setting of the 'Connections' in the DSN attribute defines the limit superior on user connections; that is, connections by applications and tools such as ttIsql, ttMigrate etc etc. There is also the concept of connections 'system' (subdaemon, replication agent, agent of cache etc) that do not count against the total "Connections."

    In your case, the database is in fact properly configured for a maximum of 500 user connections. However, as you can see on the first ttStatus, you already have 23 application direct mode of 4 different connections methods of Java (which leaves the available user 477 connections). I of course have no idea what these applications are but probably your. This means that you are able to open additional connections a 477 application before arriving to the configured limit of 500. And that's exactly what we see; When you run your test application (what happens to connect via client/server), it reached 477 connections and then impossible to create more. As expected.

    Therefore, to allow connections you must:

    1. stop the database (replace ramPoilicy by manual (or inUse), stop all applications, stop the replication agent, unload from memory if the policy is manual)

    2. change the value for connections in the attributes of the DSN to a higher value (perhaps 600) - also, you need to make sure that OS semaphores are high enough to allow this number of connections.

    3. load the database back in memory, start the replication agent, starting applications.

    A a tied note, use of ramPolicy 'always' is not encouraged. In addition to the scenarios 'manual' is a better choice. We can "always" deprecated in a future release.

    Chris

  • Lightroom 6 used the maximum number of computers

    Recently, I had a complete system on my desktop PC crash and had to replace my card motherboard and CPU. Since that my copy of Lightroom 6 tells me it has already been used on the maximum number of authorized machines. Other than disabling of copy on my laptop (the second device), can someone tell me how to get my copy to work on my PC refurbished please?

    Hi RefereeJones,

    Please see the troubleshooting link below.

    "Activation limit reached" or "connection error impossible ' with Adobe applications

    otherwise contact Adobe Support: contact customer service

    Let us know if that helps.

    Kind regards

    Mohit

  • Impossible to reload acrobat adobe XI - has reached the maximum number of times

    Impossible to charge adobe acrobat XI - I reached the maximum number of times. Any idea who I can contact to help with this. I feel I'm getting of the race.

    You can install Acrobat as many times as you want, but there is a limit on the number of activations.  If this is your problem, you should contact customer service to reset your number of activations.

  • Connect the question: "you can't access this meeting because you are already attending the maximum number.

    Hello

    Since Monday, we often get the error message "you cannot access this meeting because you are already the maximum number of authorized meetings (2). "Please close one of your meeting rooms, open" when you try to enter in the meeting rooms.

    We checked several times and we * never * have other meeting rooms to open, not even to other accounts.

    We also does not change our subscription or our account.

    We then logout / login several times before we can enter the meeting room.

    It is very annoying, because we use Adobe Connect to give training courses, and teachers can not connect.

    We thought is a temporary problem with Acrobat Connect Pro, but as said, he dwells on since Monday, March 18, 2013.

    Can someone help out us here?

    Thank you

    Jorma Hello,

    Thanks for your reply.

    If it is due to a change of political license by our Adobe reseller application. They were not informed of this change :/

    So nothing to do with Acrobat Connect Pro is.

    All the best

  • "Failed to set the maximum number of files to open."

    This is the message I get when I open adobe illustrator and then it closes just, what do I do?

    I'm on a Macbook pro

    Error at launch. Unable to set the maximum number of files... | CS6 | Mac OS

    Mylenium

  • I am trying to replace my iphone 6 s model n °: A1688, FCC ID: BCG-E2946A, IC: 579C-E2946A. but I can get the serial number because its doesn't turn only not on how can I replace it?

    I am trying to replace my iphone 6 s model n °: A1688, FCC ID: BCG-E2946A, IC: 579C-E2946A. but I can get the serial number because its doesn't turn only not on how can I replace it?

    Take it to your local Apple store. They will find it for you.

  • Can I get the serial number of the iOS, IMEI/MEID, CDN and ICCID by code device when I am developing an application?

    As the title suggests, can I get the serial number of the device iOS device, IMEI/MEID, CDN and ICCID by code, someone says I can't do that, I'm very confused. Can someone show me the Apple document on this subject?

    For reasons of confidentiality, Apple doesn't want you to access specific information of any peripheral such as MAC IMEI, UDID, address, serial number, etc and has been remove support for this kind of information the SDK for awhile now.  Your application will be rejected if you try to use private methods, that's probably what they were talking about.

Maybe you are looking for

  • When I open firefox it opens two tabs is there a way to solve it so it only opens a tab

    When I open firefox it opens two tabs is it possible to fix this s

  • LibreOffice and Mac equivalents

    My nine-year old grandson bought a raspberry for Christmas Pi and want to use LibreOffice as a system of processing/powerpoint. Until it doesn't, can someone tell me if Apple Pages, Keynote, and Numbers to support the document formats created by Libr

  • Software support of blackBerry PlayBook?

    Greetings, The announcement said with the mixture, I have "access to all your files on any device! Does this mean that mix will be available for the PlayBook? Thank you Shane.

  • My Pictures folder will not "reorganize by" something other than the 'folder '.

    It happened after that a 3rd party registry restore point has been activated.  I tried to re - restore, but to no avail.  I'm stuck in: [arrange by: 'File' (only).]  I can't fix me by 'Months', 'Day', 'Grading' or 'Tag' in the drop-down list?  I must

  • Audit trail

    HelloI want to know the audit tables stores just the old data(before changes) or new data too?I mean that for example:1. the value of column EMPLOYEE was 'John '.2. someone updated the EMPLOYEE of "James."In this case. table of audit will have 2 reco