How interrogate the top 100?

Hi, I have this code:
select     i.INVESTOR_CODE , 
i.investor_name , 
sum(invoice_commission) as commission ,
sum(INVOICE_SUBTOTAL) as total   <<<<
from investor i , invoice inv
where INVOICE_DATE  between  '01-JAN-08' and '31-DEC-08'
and i.INVESTOR_CODE = inv.INVESTOR_CODE
group by i.INVESTOR_CODE , i.investor_name
order by total;
Can someone PLEASE re - write this query so it can become the investor top 100 with the highest 'total '.

Thank you...

NOT TESTED

select * from (
select     i.INVESTOR_CODE ,
i.investor_name ,
sum(invoice_commission) as commission ,
sum(INVOICE_SUBTOTAL) as total   <<<<
from investor i , invoice inv
where INVOICE_DATE  between  '01-JAN-08' and '31-DEC-08'
and i.INVESTOR_CODE = inv.INVESTOR_CODE
group by i.INVESTOR_CODE , i.investor_name
order by total desc)
where rownum<=100

- - - - - - - - - - - - - - - - - - - - -
Kamran Agayev a. (10g OCP)
http://kamranagayev.WordPress.com

Tags: Database

Similar Questions

  • How to calculate the top 100 in analytical report of obiee 11g?

    Hello

    I am creting report Analytics obiee 11g.

    I plug 5 columns, balance, status of the loan, district loantype.

    I want to display the data from the highest of 5 columns in the analytical report...

    For this report, I would like to add customized lines...

    My requiremt, I want to show the top 100 sales, the total amount outstanding

    and I want to add personal calculation as (total of balances / top 100 outstanding balance) * 100

    Please help me,

    I tried, I don't get.

    Please help me, how calculate these?...

    Thank you and best regards,

    A.Kavya

    Hello Kayva,

    First of all, must be defined, the grade you want, ask yourself, if you want to rank by period, branch etc, so you must use "RANK (according TO SIZE).

    I made a sample with the similar columns you use, please give.

    I've done 4 criteria using 'UNION' (not 'UNION ALL', not 'INTERSTECT', 'LESS'):

    And my results are:

    Check it out:

    1st test:-J' have the sum 187 157 538.57 as the sum of the top 10 projects, the Company (Empresa) and period (Mesanodocum)

    2dont criteria: -check the second line "SumaTotalProyectos" which is the sum total of society in Ene-2015 (January 2015) for all projects. Who is 211 249 318,42

    3 criteria:-check the 187 157 538.57 which is the sum of the top 10 projects

    4 criteria: -which is the percentage of it, 187 157 538.57 / 211 249 318,42 = 88.60%

    How can you put?

    1. allows you to check the criteria 1: the sum of the top 10 projects

    Check the filter of RANK

    2 to check the 2 criteria: total sum of society

    3 to check the 3 criteria: ranking of the sum

    4 to ensure criteria 4: percentage

    Note:

    As you can see I have two projects "columns", I need to get the sum of ranking, for example, you must do a ranking by branch and get the same, has twice this column to your criteria and after it allowed you to exclude.

    Kind regards

  • How do the top bar in view above the file Edit View etc.?

    I can accidentally pressing an F key but I have tried them all and the bar at the top does not.
    The bar that says no answer etc..

    You can use one of them to set toolbars to display.

    • Firefox '3-bar' menu button > customize > show/hide toolbars
    • View > toolbars
      Press the ALT key, or press F10 to display the Menu bar
    • Right click on empty toolbar space

    You can enable or disable switch title bar via the "Title bar" button at the bottom left in the palette to customize window.

  • [BEGINNER] How interrogate the groupOfNames for a Member?

    Hi all!
    I need programming ROLE authentication on a server of the OID.
    I have two branch: one for individuals and one for the roles.
    There are two roles: Admin and user.

    DN: uid = Admin or = People, OU = NMS
    objectClass: top
    objectClass: person
    objectClass: organizationalperson
    objectClass: inetorgperson
    UID: administrator
    CN: theboss
    SN: theboss
    userPassword: secretpassword1

    DN: uid = guest, or People, UO = = NMS
    objectClass: top
    objectClass: person
    objectClass: organizationalperson
    objectClass: inetorgperson
    UID: comments
    CN: guestname
    SN: guestsurname
    userPassword: secretpassword1

    DN: cn = Admin, OU = roles, OU = NMS
    objectClass: top
    objectClass: groupOfNames
    CN: Admin
    Member: uid = Admin, ou = People, OU = NMS

    DN: cn = users, or roles, OU = NMS =
    objectClass: top
    objectClass: groupOfNames
    CN: user
    Member: uid = guest, ou = People, OU = NMS

    What I try to do, is a search that returns to the role of a uid.
    For example, given the uid = comments how can I know that the user belongs to the user role?

    The following search (in Java) returns nothing...

    SearchControls CTL = new SearchControls();
    Filter string = "(uid=guest)"; "
    NamingEnumeration results = ldapContext.search ("ou = roles, OU = NEM", filter, CTL);

    Any help?
    Thank you
    Frank

    You can create a ldap query "and" as follows:

    (&(objectclass=groupofuniquenames) (uid = 982374923874))

    -Kevin

  • How interrogate the EM repository for a list of targets that have no targets defined properties and therefore will not be members of groups identified by the hierarchy of administration.

    Hello

    Asked me to do in control cloud 12 c,

    ""Repository queries EM to get the list of targets that did not target defined properties and therefore will not be members of groups identified by the hierarchy of administration.".

    and I was looking for more information on how to do it but I can't find anything on the repository tables, and I can't find how to get this cloud control options.

    Thank you

    Matt

    Management Group page, go to the Associations tab and click the target report unassigned

  • How interrogate the error of flow

    How to find the error generated by oracle streams and where I can the found

    You can see DBA_APPLY_ERROR. But other views have information about the error, such as:

    SELECT THE FUNCTION ERROR_MESSAGE, ERROR_NUMBER, STATUS_CHANGE_TIME, CAPTURE_NAME
    FROM DBA_CAPTURE WHERE STATUS = 'LEFT ';

    Capture, propagate and apply all have versions of this type of information.

    You can also view the status of the workflow through OEM (Database Control or Grid control).

  • How interrogate the tablespace size increment speed?

    Hello

    Do you have information or ideas on how to know the history of tablespace size slices. or how to know the frequency of the increase in size of the tablespace.

    When I walked into the new database, I never managed this database before, I want to know the size tabelspace increments range from speed to make reasonable space.

    so could you please give us a guide thanks!

    Hi RLUO,

    You can use DBMS_SPACE. OBJECT_GROWTH_TREND to find the trend in the growth of a segment.

    Please refer to:

    http://www.Oracle-training.cc/t_oracle_segment_growth_prediction.htm
    Space - DBMS_SPACE management. OBJECT_GROWTH_TREND - how to run

    Concerning
    Rajesh

  • How interrogate the Spec of Formulation of the hardware specs?

    Hello

    I am building an application that animates its data from the specification of trade that connects to the specification of equipment and material for formulated related specifications.  I'm stuck trying to find the table that links between specifications of formulated material to the specification (tab: "Related Spec"-> Section: "Produced By").  Can someone help me identify the tables that I need?  I went through the document DatabaseAndObjectSchema for PLM4P Agile and have exhausted my resources.

    -Here's a sample of my incomplete request

    Select ms.specid, ms.specnumber, s.specid

    of s agile.specsummary-trade Spec

    Agile.gsmtradematerialspecrelation gts,-trade material connection

    Agile.specsummary ms - Hardware Spec

    where s.specid = gts.fktradespec

    and gts.fkmaterialspec = ms.specid

    Thank you.

    Yoko

    The query I gave above should work the specification of trade, assuming that the value of context of Formulation is selected to choose what Formulation technique produces this material specified on the specification of trade. However, if you do not choose the specification of the formulation, or you simply want to get the specifications of possible Formulation that produces this material specification, try the following:

    SELECT formSpecSum.SpecNumber
      FROM MaterialSpec matSpec
        INNER JOIN gsmFormulationOutput formOutputs on matSpec.pkid = formoutputs.fkReferencedMaterial
        INNER JOIN gsmFormulationSteps  formSteps on formOutputs.fkFormulationStep = formSteps.pkid
        INNER JOIN dwbSpecifications dwbSpec on formSteps.fkParent = dwbSpec.pkid
        INNER JOIN dwbSpecificationRoots dwbroots on dwbroots.pkid = dwbSpec.fkWorkingVersionParent
      INNER JOIN formulationSpecification formSpec ON dwbroots.fkOWner = formSpec.pkid
      INNER JOIN SpecSummary formSpecSum on formSpec.pkid = formSpecSum.specID
    WHERE matSpec.pkid = 'YOUR PKID HERE';
    

    I would like to know if it works for you.

    Thank you

    Ron

  • How can I go to the top of a Web page without scrolling?  On a PC, I hit the 'Home' button

    How do the top of a Web page without scrolling?  On a PC, I hit the 'home' button

    If you are using Firefox, you could hit the 'Home' button

  • Provider Unable to Submit eQ &gt; &gt; you are looking for "how to the database.

    Hello.  We have a supplier who was sent to a couple of EQS material with custom Sections.  They indicated, and I have confirmed, that can save the eQ without incident, but when they try to click on send, an unhandled exception message.  Our event logs are showing below the stack trace.  I interpret it as meaning that there is something on a particular custom section that the database considers necessary.  Given that it is not displayed in the eQ UI, I want to ask to the database "which is necessary on this customized for this particular eQ Section.  Unfortunately I was not able to get to the right SQL to get an answer to the question.

    We know the requestID for the equalizer and 1020746cb807-aa95-4088-b12e - 0a 6878746874 has been identified as a particular custom section within the equalizer.  Nothing is prepopulated in the eQ and the provider may choose to add lines.  In this case, nothing has been selected to submit it.  When there are data in the custom section, the index in the error value changes to 1.

    In the meantime, the vendor is on hold...  The forum can help?  Recommendations on the tables I should be showing through?

    Thank you.  -BeckieC

    = Stack trace =.

    ErrorType: First | ErrorCount: 0 | App: SP | SessionId: * hidden * | UserId: null | IsNewSession: False | ServerID: xxx.xx.xx.xx | Misc: |

    Exceptions: System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. -> Xeno.Prodika.Common.AssertionException: value 'Could not find a line with an index of 0 in the model section 1020746cb807-aa95-4088-b12e - 0 a 6878746874' cannot be null

    at Xeno.Prodika.Common.Assert.Fail (String msg)

    at Xeno.Prodika.Common.Assert.NotNull (String name, Object value)

    at Xeno.Prodika.EQ.Service.DomainModel.GeneralEQ.BaseQuestionnaire.ValidateCustomSections (IExtendedAttributeSectionContainer container, IEQModelSection modelSection)

    at Xeno.Prodika.EQ.Service.DomainModel.GeneralEQ.BaseQuestionnaire.Validate (IEQCustomSectionModelSection eqCSModelSection)

    at Xeno.Prodika.EQ.Service.DomainModel.IngredientEQ.IngredientQuestionnaire.Validate (IEQCustomSectionModelSection eqCSModelSection)

    at Xeno.Prodika.SupplierPortal.WebUI.GeneralQ.SaveAndSubmit.Submit (Object sender, EventArgs e)

    to System.Web.UI.WebControls.Button.OnClick (ByVal e As EventArgs)

    at System.Web.UI.WebControls.Button.RaisePostBackEvent (String eventArgument)

    at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent (String eventArgument)

    at System.Web.UI.Page.RaisePostBackEvent (IPostBackEventHandler sourceControl, String eventArgument)

    at System.Web.UI.Page.RaisePostBackEvent (NameValueCollection postData)

    at System.Web.UI.Page.ProcessRequestMain (Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    It was decided that since we cannot understand how interrogate the database, we the provider submit a new eQ and do data entry.  SR would not provide a timely resolution to the need for this provider.  No SR will be submitted for this issue.  New EQS have been sent and provider will rework the data.

  • HOW CAN I REMOVE THE "WEB SEARCH" TOOLBAR THAT IS LOCKED TO THE TOP OF MY SCREEN?

    HOW CAN I REMOVE THE ' SEARCH INTERNET / FACEBOOK / INTERNET RADIO / GAMES "TOOLBAR THAT IS LOCKED TO THE TOP OF MY SCREEN?  CHANGE IN THE RECENT WINDOWS UPDATE 7 AUTO.  IT BLOCKS ALL THE TOOLBARS ON MY PROCGRAMS WHEN THEY OPEN IN FULL SCREEN (ZOOM 100%)

    Successfully removed using standard MS Uninstall.

  • Help! How to create a navigation bar by tabs on the width 100% accordion that pushes also down of content

    Hello

    I keep seeing 100% width beautiful navigation bars that work like accordions, they open upward and push down the content of Web sites. But no idea how to do myself in Adobe Muse.

    An example is Adobe Muse Widgets Web site: http://www.muse-themes.com/collections/adobe-muse-widgets

    I want to create something similar in the top gray navigation bar. When you click on the 'support' section it drops in a submenu that is 100% fixed width and pushes down the rest of the content on the Web page. I know that the current accordion can be created as 100% width and can push down content when opened. But it does not feet, so I don't think I can create the navigation bar I'm after.

    If anyone knows how to do this, please can you help me to get this effect.

    Thank you

    Kirsty

    Take a look at this small sample file:

    https://DL.dropboxusercontent.com/u/7046655/sample.Muse

    He he, what you want?

  • At the start of the fan to the top and stop at 100%

    Hello people.

    There are not many things to add really on what I said in the topic. When I turn on the PC the gos Fan until I can only describe as 100% (Jet Engine) and it remains at 100% to the bottom of the screen, and only when it seems sensors and the Fans of Apears on the bottom right of the screen. When this produces fans starts to slow down its normal speed and the PC becomes quite once more... Now, this is obviously something that something has been damaged inside the pc, now wiz im not a PC and I am always fully covered by Dell for next day repairs but not right ide and I worry rather see if I can try a fix myself before getting someone to appear at my house. Again, as mentioned on my subject Shut down is the same when I select a stop down the wiz fans themselves up again what I can only describe as 100% and to 100% of the power is turned off completely... any help is welcome for me.

    on a side note the PC works quite well when it works (and when the Fans stop going crazy)... Checks system COMPLETE and Dell came up with zero problems (all ticks)

    If you need any information on what this pc is running do not hesitate to ask.

    Thank you

    What is - this: x 51, Aurora, Aurora ALX, Area 51. It is new or used. Was it b4, then suddenly done this, or you are the new owner & your 1st experience w/year A-ware.

    For background, my Area 51, in the command center > ventilation Active, I have a checkbox called: 'stirs up vents & fans @ startup. When the box is checked, at startup my system to life... rev fans as the limitation of a car engine; Apparently, it is to serve all parties fair warning that my system is loaded with power & can shake the land down under. Fans of the gas and then slowly down to a whisper. It is a design feature intended to intimidate the competition & earn points with your friends, amazed by the sound of the fire breathing Dragon. A system that roars to life, imbuing its wonderful nature, then settle down, could be (and should be) quite normal for your model. One who reproduced this behavior to the power down does not ring true, can be a sign of something glitch.

    Start by unchecking the flare fans, if your has CmndCntr of this feature.

    Alternatively, you can unplug your pc, press the power button for a minute, then start again in a few minutes; It's 'power dissipation reset' we all learned to do, to tame the material CmndCntr. Try 2 or 3 times would be normal & is useful.

    Alternatively, you can go to the Forum splashpage & @ find it at the top of the page: READ FIRST! Troubleshooting Alienware by model articles > from there, find your model & article on how to uninstall/reinstall CmndCntr. Note the caveat that "uninstall/reinstall CC may take a few attempts until the system returns to normal." You can launch CmndCntr, & under options, find your version of CC & reinstall w/same version as you have now, under the name of best advice. If none of these vegetable variety healing work.

  • How to restore the calculator application to drag it to the top of the screen to control

    Can how I restore the calculator to drag it to the top of the screen to control center? It seems to have been removed from the bottom row? Thank you

    Are - what you got to remove the calculator of your applications on the phone? You can find the calculator on the phone itself? If you find it, then try a reset. Hold down the home and sleep/wake together until you see the Apple logo and then release. The phone will restart. There are no settings to change what appears on the display. See if the reset solves your problem.

    EDIT: what exactly you see in the Control Center? If you see only controls the music, then drag to the right to see the rest of the access to the control center.

  • How to get the phone and messages back in my dock apps? And for some reason, I discover now all my app pages from the middle of my phone and not at the top?

    How can I get the phone and messages apps in my dock? And for some reason, I discover now all my app pages from the middle of my phone and not at the top?

    Try

    Settings > general > reset > reset home screen presentation.

    Note: All other applications will be organised by alphabetical order.

Maybe you are looking for