Sum(misses)/(sum(gets)

Hi,
is it any way to combine all these :
select name, gets, misses,
immediate_gets, immediate_misses, sleeps
from v$latch
where name in ('redo allocation', 'redo copy')
set head off
select 'Ratio of MISSES to GETS: '||
round((sum(misses)/(sum(gets)+0.00000000001) * 100),2)||'%'
from v$latch
where name in ('redo allocation', 'redo copy')
select 'Ratio of IMMEDIATE_MISSES to IMMEDIATE_GETS: '||
round((sum(immediate_misses)/
(sum(immediate_misses+immediate_gets)+0.00000000001) * 100),2)||'%'
from v$latch
where name in ('redo allocation', 'redo copy')
Many thanks.

I tried this
SELECT name, gets, misses,
immediate_gets, immediate_misses, sleeps, 'Ratio of MISSES to GETS: '||
round((sum(misses)/(sum(gets)+0.00000000001) * 100),2)||'%', 'Ratio of IMMEDIATE_MISSES to IMMEDIATE_GETS: '||
round((sum(immediate_misses)/
(sum(immediate_misses+immediate_gets)+0.00000000001) * 100),2)||'%'
FROM v$latch
WHERE name IN ('redo allocation', 'redo copy')
GROUP BY name, gets, misses,immediate_gets, immediate_misses, sleeps
but I have
query column #7 ('RATIOOFMISSESTOGETS:'||ROUND((SUM(MISSES)/(SUM(GETS)+0.00000000001)*100),2)||'%') is invalid, use column alias
Please help.

Similar Messages

  • Fn:SUM in Xquery getting error

    Hi All Gm,
    I am using fn:sum in xquery.I am getting multiple data as request.
    Using fn;Sum if I add more 7 digits ,it is  converting to hexadecimal.but I don't want to convert hexadecimal value.
    ex:
    fn:sum(9999999,0,100)= 9896E3.(sum of 8 digits converting to hexadecimal)
    if I sum fn:sum(9999999,0,0) = 9999999(sum 7 digits is working fine).
    But in my service I am getting input data value as more than 7 digits, in this case fn:sum is failing
    Any one could please can help me on this?
    is there any other way to aggregate the values in xquery with out using fn:sum.
    Thanks in Advance,

    Very good question, but the solution is even more simpler than I thought !
    You just have to type-cast it to xs:long !
    Use something like this :
    xs:long(sum($po/order-item/(@price * @quantity)))
    Hope this helps...

  • HELP "Select SUM(x), SUM(y)" different between 8.1.6 and 8.1.7.2 ?

    The following query runs fine under 8.1.6 but returns bad result under 8.1.7.2 :
    SELECT SUM(NBANOMALIE4), SUM(NBANOMALIE2)
    FROM
    (SELECT COUNT(*) "NBANOMALIE2" FROM CPN A, ANOCPN B WHERE A.CODENS= '128' AND B.CODANO='2' AND A.NUMFOR = B.NUMFOR ) ,
    (SELECT COUNT(*) "NBANOMALIE4" FROM CPN A, ANOCPN B WHERE A.CODENS= '128' AND B.CODANO='4' AND A.NUMFOR = B.NUMFOR )
    GROUP BY NBANOMALIE2, NBANOMALIE4;
    Result given under 8.1.6 is
    SUM(NBANOMALIE4) SUM(NBANOMALIE2)
    1 0 (correct)
    Result given under 8.1.7.2 is
    0 0 (wrong)
    if query is changed to "SELECT SUM(NBANOMALIE2), SUM(NBANOMALIE4) ..."
    Result given under 8.1.7.2 is
    1 1 (wrong too !)
    actually the result given for ALL is the result of the last "SUM()" in the select ...
    Is it a bug ? if so any patch ? Is there a workaround ?
    Thanks for any help
    Charlie [email protected]

    a solution was to use decode()
    here is a workaround :
    SELECT DECODE(B.CODANO,'2',1,0) NBANOMALIE2, DECODE(B.CODANO,'4',1,0) NBANOMALIE4
    FROM CPN A, ANOCPN B
    WHERE A.CODENS= '128' AND B.CODANO IN ('2','4') AND A.NUMFOR = B.NUMFOR;
    I had it from http://www.orafaq.com/. ...
    Charlie [email protected]

  • Sum the sum of fields in crystal report

    In crystal report 2008, i have rows of data grouped by document number. Sum of each document (RTotal1) display at Group Footer.
    At the Report Footer level, I want to display the Grand Total. In formula workshop, I tried to add a formula to sum RTotal1 above. However, error message indicated 'this field cannot be summarized'.
    Second try: In Running Total Fields, I tried to add RTotal1 above to the field but error message indicated 'invalid field selection'. Any idea what's the proper way to sum the sum of fields?

    You need to use a variable, create 3 formula
    @reset
    whileprintingrecords;
    global numbervar GTotal:=0;
    //place this in report header, or higher grou header as appropriate
    @Eval
    whileprintingrecords;
    global numbervar GTotal:=GTotal + Sum( valuefield, groupfield);
    // place this in group footer where your sum shows
    @display
    whileprintingrecords;
    global numbervar GTotal;
    //Place this in report or higher group footer
    Ian

  • Missing sum field in ALV

    Hello all,
    due to a consolidation of SAP-Systems we copied some reports.
    One of them creates an ALV-List by a selection and everything is working fne, except that the "sum"-Symbol is missing in the ALV-List of the new System.
    Nothing was changed in the report... only the releases are different:
    Old System: R/3 Release 4.6C
    New System: SAP R/3 Enterprise (Abap and Basis 620)
    Are there any other possible reasons?
    Thanks and regards,
    David

    Thank you!
    Now it works!
    However I don't really understand why it worked in the old system... we copied all sources and objects.
    Regards,
    David

  • How to Recursively Sum a Sum?

    Sorry, everyone, this is driving me nuts.  I have the following query, which gives me the relative percentage of [INDEX MARKET CAP].
    SELECT *, [INDEX MARKET CAP] * 100/SUM([INDEX MARKET CAP]) OVER() as [%]
    FROM [S&P_Emerging_SmallCap_(US_Dollar)]
    So, I get a sum of the [INDEX MARKET CAP], and then find the relative percentage of each items in the INDEX MARKET CAP.  Great!  now, I'm trying to modify the query a bit to give me the SUM of each relative INDEX MARKET CAP.  So, the sum will
    be 100%!  I just want to prove that the query works.
    I'm trying to follow the example here.
    http://technet.microsoft.com/en-us/library/ms190766%28v=sql.105%29.aspx
    It seems so simple, but this dang thing just won't work.
    I think it should be something like this.
    ;With CTE (Company, [%])
    AS
    SELECT *, [INDEX MARKET CAP] * 100/SUM([INDEX MARKET CAP]) OVER() as [%]
    FROM [S&P_Emerging_SmallCap_(US_Dollar)]
    Select Company, SUM([%]) as Total
    FROM CTE
    Group By Company, Total
    I keep getting this.
    Msg 156, Level 15, State 1, Line 3
    Incorrect syntax near the keyword 'SELECT'.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. The garbage you
    posted has spaces in it! That means that you cannot use those names in any ISO standard programming. You are an 1950's COBOL Programmer who does not understand tiered architectures, so he writes headers for display instead of having a presentation layer. In
    fact, you are even worse with all that meta-data garbage in your data elements. USD is a unit of measurement on a scale, not part of a data element name. Is there any way you can get a book or course in basic data modeling?? 
    Why do you think that “company” is a clear, precise data element name that is an industry standard? It is not! This generic, vague and useless. I would guess that you are using a ticker symbol or a DUNS as the identifier. But it might be “company_<anything>”
    or worse. What is that generic “total”? Why did you destroy any hope of a data dictionary with crap like [%]?? First of all, we use double quotes in ANSI/ISO Standard SQL, so this disaster should have been “%” without the brackets. Why do you think you can
    use that  one character name anywhere else? What language? The best it could be is "generic_percentage", so that programmers that follow you will know it is crap. Pros write code for the maintenance guys that have not been hired yet, not for personal
    spreadsheet use. 
    50 years ago when you were writing COBOL, there was a hierarchical record structure. In RDBMS, rows are not records and columns are not fields. The fields (attributes) are drawn from domains of scalar values. The names exist in those domains. Your automobile
    is a VIN everywhere in the universe! It is not local. 
    Temporal data should use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. 
    >> Sorry, everyone, this is driving me nuts. I have the following query, which gives me the relative percentage of [INDEX MARKET CAP].
    SELECT *, [INDEX MARKET CAP] * 100/SUM([INDEX MARKET CAP]) OVER() AS "generic_percentage" FROM [S&P_Emerging_SmallCap_(US_Dollar)] <<
    >> So, I get a sum of the [INDEX MARKET CAP], and then find the relative percentage of each items in the INDEX MARKET CAP.  Great!  now, I'm trying to modify the query a bit to give me the SUM of each relative INDEX MARKET CAP. So, the sum will
    be 100%! <<
    No, it will not. In fact, you will be lucky to get 99.99% -- do you understand rounding errors? Since you were rude (really, really rude by SQL Forum standard, in fact)  We have no idea what data types we have here; we have to guess you used DECIMAL(s,p)
    so you might get better answers with “index_market_cap * 100.0000 /SUM(index_ market_cap) OVER() AS index_market_cap_percentage”; See the decimal places? Unlike spreadsheet, we have to worry about this in SQL. 
    As far as your error goes, look at the CTE column list and the GROUP BY; they do not match ! 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Sum the Sum total values above

    Post Author: John Patterson
    CA Forum: Formula
    I have created a report that contains a list of values (in a group) that come from a formlar that has Sum {} totals in it.  All I want to do is sum that list into one value below, just like Excel would do!
    Crystal won't allow me to sum the results of group sum totals higher up the report.   I have been told that I need to create a conditional running total or a set a variable to store the values required.
    Any ideas?
    Many thanks
    John

    Post Author: fusion
    CA Forum: Formula
    Definitely Jami,I found out that Running Total is an answer. I still  need to find out how to get a percentage of the total using a running total. When you use a summary option then there is a option that allows you to have the filed as a % of the total of that filed. How can you do the same using running total. I am trying to work with formulas but no any luck so far.Your help is highly appreciated

  • Measure aggregate sum not summing

    Hi
    I have many universes, and for all universes I have set measures to sum, where appropriate. However, this seems to work sometimes, and not others. I can't work out when or why it does or doesn't! Does anyone have experience of this?
    Thanks

    Hi Louise,
    Let me try to explain in a bit more detail...
    The a) aggregation is done by the group by clause in the actual select that is sent to the database,
    so it differs depending on what the user selects when building the query.
    But it will do this using the aggregation function you specified in the select.
    So if you have
    measure object sales sum(sales.amount)
    dimension objects country country.id and store store.id
    Then the select for a query containting the two objects sales and country would have a group by country.id
    The select for the query containing all three objects would have a group by on country.id,store.id
    You can verify the actual group by by looking at the generated SQL in the query builder.
    The b) aggregation is done according to what is specified in the advanced tab.
    You see this tab when you are in Designer and open the object properties dialogue.
    Its the second tab in it. (first is the select and where box, second it the aggregation (top part) and list of values (bottom part).
    So say you selected all three objects and then created a table with only country and sales, the sales figures (that were queried per store, per country) will be aggregated according to that 2nd tab to the country level.
    Note that when you use an aggregation function in the select, Designer will make a best quess as to the aggregation wanted and pre-fill it. So for the sum() function, it will also use sum as aggregation in 2nd tab.
    Hope this helps
    P.S. looking at the actual generated SQL will also help you determine if you have more that one select done to fullfill you dataprovider. If you have more than one, it is only acceptable if the differences are in measures only. If not, you will get more than one cube back from your query, without any control over how they are synchronized. If so you can try multicube to get the results you would expect (i.e. seen as one big cube i.s.o. more than one).

  • I just updated to Numbers 3.0.1. In the old version if I started to type a name that was already in the spreadsheet, it would automatically fill it in. That doesn't happen in the new version. What am I missing to get that to happen?

    I just updated to Numbers 3.0.1. In the old version if I started to type a name that was already in my spreadsheet (in another cell), it would automatically fill that name in. That is not happening in the new version. Am I missing something to get that to happen? Thanks

    If you frequently enter repeating values in a column and don't want to type the same text over and over again, instead of just waiting for Apple's updates why not try using an enhanced feature in Numbers 3 that in many (probably most) situations is even better than "auto-complete"?
    Numbers 3 has an enhanced Pop-Up Menu functionality that helps prevent typos or capitalization inconsistencies from creeping in and messing up your data. It is also much more efficient than auto-complete in Numbers for iOS, should you ever want to sync to an iPad or iPhone and do data entry there.
    Pop-Up Menu is much enhanced over what it was in Numbers 2.3, and is easy to set up:
    Select the whole column or range before formatting as Pop-Up Menu and your existing values in that column or range will pre-populate a menu automatically:
    Then you can remove the values you don't want in the list, such as the column header (and possibly some previous spelling errors too!):
    And after this easy one-time setup all you have to do thereafter is to choose from the pop-up list when you add rows:
    See this post for more details on how this handy feature has been enhanced in Numbers 3.0.
    Should you ever want to take your Numbers with you and do data entry on an iPad or iPhone, in a touch interface, pop-ups are much more efficient than typing the first few letters of items. You can scroll with ease through a list of dozens of items to make a pick. Anybody using Numbers cross-platform should favor Pop-Up so they can use their documents efficiently for data input on the go, which can be a productivity booster.
    See this thread for this and other workarounds for Numbers 3.0.
    SG

  • Missing the "get new email" animated circle in 10.8.5

    Hi,
    since my upgrade to 10.8.5 (to get a more stable OS), I no longer see the circle behind my inboxes when I Get New MAil?
    Did I miss a setting to get this animation going, as I have no way of seeing if Mail is actually fetching my new mail
    Thanks,
    W.

    Forget about Apple thinking for us.... I just hate it when features are taken away rather than replaced..
    For ten bucks I have my animated gear and wheel back !
    SImply installed Postbox. Works like a charm, actually gives me more features than Mail 6.6
    Check it out on http://www.postbox-inc.com/
    Said goodbye to Mail after 10+ years.

  • Obligatory node 'E1OILKV' missing, Not getting'12'Status fromR/3 to XI Port

    Hi,
    I am sending the Customer Master Data from R/3 to XI. I enhanced the Idoctype OILDEB06 to ZOILDEB06. I am getting the message code status as 03. "Data sent to the Port". But if i execute the the Report RBDMOIND. It is not moving to status 12. "Despatch Ok".
    I Got the error message in the tRFC as "Obligatory node 'E1OILKV' missing in the structure".
    I am able to see the structure E1OILKV in the IDoc with data. But why this error is coming.
    Could any one can help on this Issue.
    Thanks and Regards,
    Venkat.

    The Idoc is going to the Recieving End only till the General View and Company Code view. E1OILKV Segment comes under the Sales View. Since Sales view is not changed it is not capturing the Change Pointers. If Sales view is avilable in the Idoc it is not going to the XI Port. tRFC gives the error.
    We checked for other Idocs Which were enhanced. Those other IDocs{example Cost center,Vendor Idocs} are going.
    I tried to send the Standard Idoc OILDEB without the Enhancements. It is going to the XI Port. Once i Send the OILDEB06 With Enhancements. It gives that error.Obligatory node 'E1OILKV' missing in the structure. As i already said, I am able to see Data in this segment using the Idoc editor. But not fully moved to the Configured XI Port.
    Thanks,
    Venkat.

  • How do I get rid of a message "airlocks32.dll" is missing, I get it every time I re-boot.

    how do i get rid of message "airlocks32.dll" is missing, happens every time I boot.

    And what does that (allegedly) have to do with Adobe software? you need to explain better and provide a lot more info, including at least some basic system specs.
    Mylenium

  • TS5376 Tried Apple's fix for MSVCR80.dll missing, still getting error

    I found this fix:
    http://support.apple.com/kb/TS5376
    I removed the dll's as instructed, uninstalled iTunes from Control Panel, redownloaded the 11.1.4 installation file, saved and executed it, and successfully reinstalled iTunes.
    But when I try to start iTunes, I still get this error:
    "The program can't start because MSVCR80.dll is missing from your computer. Try reinstalling the program to fix this problem."
    I've been running iTunes on this Windows 7 machine for years, I've upgraded iTunes via Apple Software Update many times, and now this.
    Apple did you blow it?
    Dead in the water.

    Further measures described here:
    https://discussions.apple.com/docs/DOC-6562
    This fixed the issue.
    Per instructions, had to completely remove iTunes, Apple Software Update, Apple Mobile Device Support, Bonjour, and Apple Application Support.  (and others if you have them, read that list carefully).
    What a pain.

  • Battery issues/Summing up sum what

    Ok, so this is what I've learned thus far and what I'm trying, period.
    I recall an engineer once advising that on items like these kinds of devices with re-chargeable batteries, I allow the battery to drain COMPLETELY in the first few days or so of using it.
    Then plug it into AC (the wall - not USB) and let the thing completely re-charge (i.e., turn the device off and just let it sit and 'cook').
    They said that was the best way to maintain the life of a battery and to get the most life FROM the battery.
    I've read all of the various stats and the blurb by Apple as to how their stats were established.
    So... I am going to try the method advised to me some years ago by an engineer. I'm going to do it over the weekend (I just got my iPhone yesterday) and will let you know of the results. If anybody else has already done this, I'd really like to hear about what happened for you with this strategy. Thanks.

    As a heavy user of rechargeable batteries for my scuba lights and camera, I followed the recommendation given for most such batteries--to "condition" the battery by completely discharging it before recharging, the first few times you use it. I plugged mine into the USB dock, not the wall, to recharge. I see various people saying that one or the other is "better", but I couldn't say about that.
    Anyway, here are my stats:
    Time since last full charge: 14 hours, 18 min
    Standby: 2 days, 2 hours
    Battery icon is showing about 2/3full (I sure wish they had a % readout)
    I've made and received a moderate number of calls, and have played about 6 hours of music.
    As far as settings go, I have turned off "ask to join networks" (since I have "taught" my phone about my work and home networks), but otherwise haven't done any of the power-saving steps. I have a Yahoo mail account that is pushing messages to the phone throughout the day. I'm within range of my known wi-fi networks pretty much all day and all night.
    So I'd say that yes, conditioning your battery is a good idea. Personally, I think this excellent battery performance is karma for having to spend 22 hours in Activation ****. Hope it works for others having short battery life.

  • Loading vi missing of Get Current Font

    Please see the attached screen. I cannot find the vi.
    Office and report toolkit both installed on this new machine.
    Can any one give it, I use 8.6.
    Solved!
    Go to Solution.
    Attachments:
    missing.jpg ‏27 KB

    Which version of the toolkit are you trying to install? There have been updates in the past, some of which were necessary to make them compatible with specific versions of LabVIEW.
    Have you checked to see if the LLB is actually there? If so, can you open it? I would recommend that you run a "Repair" on the toolkit installation, or try reinstalling it.

Maybe you are looking for

  • Mail takes a long time to connect to outgoing server

    This has been touched upon in a number of threads but I'll post my own particular version in case anyone can throw any light on it. When sending emails (Mail 3.6, OS10.5.8) it can take up to 1 minute for Mail to connect to the outgoing server. In the

  • 3D Picture Control Orthographic View zoom - Camera Set up?

    I am trying to display two 3D picture controls.  One displays some objects in 3D (Auto Projection: Perspective, Camera Controller: Spherical).  This 3D image works great and I am having no problems with it.  The other Picture Contol is meant to simul

  • Slovakian Language (SK) character display problem

    Hi, Enviroment:R3 enterprise 110 /unicode/Oracle I'm having problem with one of the character for Slovakian. It seems that the character are display correctly when displaying thru Customer master data display (FD03 ) but show garble character (# etc)

  • Error- No partner profile could be found [Idoc(KU) to File(LS)

    Hi Experts, I am creating Idoc to file scenario i.e KU to LS I have already created an outbound partner profile using transaction WE20. SNTPRT- Partner number - 1100024          RCVPRN Partner number  - PEVCLNT100 Partner Type- KU                    

  • FTP setup in Tiger

    Hi all I want to setup ftp in my G5 running Tiger 10.4.4 ,with user name password for ftp & define a particular folder or drive(local ,firewire etc.) to be publish over network(local or internet) PowerMac G-5(DP,1GB RAM,160 GB HDD)