Last (max) and the percentage

I have the following table

I try to only get the last ID were present ( Estatus) in the 1303,1313,1323,1333 CONDITIONS

I am trying to use max but having combining with the status as E and TERM in

Also, I try to get the success rate for these IDS (P, HD, D) a PASS and (N, F) is a failure

Number ID 1 even if she has run 1401 finally PRESENT mandate (E) were so the status is D 1303,1313 50% pass and fail (1 of each)

ID 2 ignore as his in 1401

ID 3 yes because it E and in these TERMS (0% failure rate)

CREATE TABLE DAN_GR5

(VARCHAR2 (12) ID,)

STATUS varchar2 (12),

UNIT VARCHAR2 (12),

GRADE varchar2 (12),

NUMBER OF MANDATE (12));

insert into DAN_GR5 (id, STATUS, UNIT, RANK, DURATION) values ('1 ', 'E', 'FRS', 'P', '1303');

insert into DAN_GR5 (id, STATUS, UNIT, RANK, DURATION) values ('1', 'E', 'DIA', 'F', '1313');

insert into DAN_GR5 (id, STATUS, UNIT, RANK, DURATION) values ('1 ', 'd', ' ' FFS, ', '1401' ");

insert into DAN_GR5 (id, STATUS, UNIT, RANK, DURATION) values ('2', 'E', 'LOP', ','1402 ' ");

insert into DAN_GR5 (id, STATUS, UNIT, RANK, DURATION) values ('3', 'E', 'POL', "n", "1323 ');

insert into DAN_GR5 (id, STATUS, UNIT, RANK, DURATION) values ('3', 'E', 'LAW', "n", "1333 ');

wanted:

ID%
150
30

Hello

Sorry, if MAX has nothing to do with this problem, so I don't understand the problem.

This example gets the results you requested, with or without the given line in your last post:

SELECT id

AVG (CASE

WHAT rank IN ('P', 'HD' ' d ' ') THEN 100

WHAT rank IN ('n', 'F') THEN 0

END

) AS pass_pct

OF dan_gr5

Situation WHERE = 'E '.

GROUP BY id

HAVING COUNT (CASE

WHAT term NOT IN (1303, 1313, 1323, 1333)

THEN 1

END

)    = 0

ORDER BY id

;

Tags: Database

Similar Questions

  • I changed my admin.password last night and the earlier my husband did a system restore on it. now it tells me wrong password

    original title: help please!

    I have windows vista on my acer aspire 5517 I changed my admin.password last night and the earlier my husband did a system restore on it. now it tells me wrong password... I don't have a dics in it plese... I need help ASAP

    Next time please post in a forum of Vista. This one is for Windows 7. But since you're here:

    You can change your password to something that you remember another administrative user account. If you had only an administrative user account and you have forgotten the password, all is not lost. You can then follow the general recommendations for implementing user accounts in Vista that I will give you at the end of this post.

    All this requires a certain level of computer skills. You know better and that take the machine to a competent local computer tech (not a type of BigComputerStore/GeekSquad place) is the best solution for you.

    If you have an installation of Vista DVD (not a recovery DVDs), you can start the system with it. Select the default language, then select "repair your computer". Then select "Command Prompt". At the command prompt, type:

    NET user administrator / Active: Yes [press Enter]
    NET user [insert here the name of your user account] [insert the new password of user as 1234 here] [press Enter]

    [Note: do not enter the brackets!]

    Remove the installation DVD and restart the computer. Now, you will be able to connect to your user account by using the password that you set; for example, 1234.

    If you do not have a Vista installation DVD (only have a recovery disk), the computer mftr. may have given you the option to repair Vista (not a system recovery!) system in the diagnostic menu. This menu of diagnosis is the same one where you can choose Safe Mode. Get to this menu by repeatedly pressing the F8 key as the computer starts. If you do not have this option, you can make a bootable Vista file repair DVD in this link:

    http://NeoSmart.net/blog/2008/Windows-Vista-recovery-disc-download/

    Note: All the Neosmart recovery disk downloads are torrent files. There is a good explanation of the torrent on the site Web of Neosmart files. You will need a torrent asmuTorrent client to get the files. Torrent client will download the .iso file with which to create the bootable DVD. You will need to use third-party burning software such as Nero, Roxio or the free ImgBurn (http://www.imgburn.com ) to burn the image .iso image file, not in the form of data.

    Once you have fixed things, log on to the additional administrative account you will be made by the suggestions below and disable the administrator account integrated yet for security reasons:

    Start Orb > Search box > type: cmd
    When cmd appears in the above results, right-click and choose "Run as Administrator" [OK]. Now, you will get the command prompt. At the command prompt, type:

    NET user administrator / active: No. [Enter]

    Exit the command prompt.

    General recommendations for creating users in Vista:

    You absolutely don't want to have only one user account. As XP and all the other modern operating systems, Vista is a multi-user system with integrated system of accounts as default Administrator and comments. These accounts should be left alone because they are part of the structure of the operating system.

    In particular, you do not want one account user with administrative privileges on Vista because the administrator account integrated (normally only used in emergencies) is disabled by default. If you use as an administrator for your daily work, and this account is corrupt, things will be difficult.  It is not impossible to activate the built-in administrator to rescue things, but there may be more that you want to do. Better not to put you in a bad situation at first.

    The user account that is for your daily work must be a Standard user, with the extra administrative user (call it something like 'CompAdmin' or 'Tech' or similar) only it for elevation purposes. As a user Standard is recommended for security reasons and will help protect your computer against infections. After you have created "CompAdmin", connect to it and change your normal user account Standard. Then log on to your regular account.

    If you want to go directly to the desktop and ignore the Welcome screen with the icons of the user accounts, you can do this:

    Start Orb > Search box > type: netplwiz [Enter]
    Click continue (or provide an administrator password) when you are prompted by UAC

    Uncheck "users must enter a user name and password to use this computer". Select a user account to connect automatically by clicking on the account you want to highlight and press OK. Enter the password for this user account (when it exists) when you are prompted. Leave blank if there is no password (null).

    MS - MVP - Elephant Boy computers - don't panic!

  • months Max and the year of the table

    Hello

    I need to get the months max and the year of a table.
    DESC WHR_REPORT
    REPORTMONTH   NUMBER(2)
    REPORTYEAR    NUMBER(4)
    Sample data in table
    reportmonth    reportyear
    01              2009
    02              2009
    03              2009
    04              2009
    09              2009
    12              2009
    01              2010
    02              2010
    How can I get the date max which means 022010 table?

    Thank you
    Sandy
    select max(to_date(to_char(reportyear) || lpad(to_char(reportmonth), 2, '0'), 'yyyymm' ) )
    from whr_report
    
    or
    
    select reportyear, reportmonth
    from
    (
    select reportyear, reportmonth, row_number() over (order by reportyear desc, reportmonth desc) rn
    from whr_report
    )
    where rn = 1
    

    I forgot to lpad around month

    Published by: bluefrog on June 10, 2010 15:59

  • SQL to bring the last line and the just previous row in the table

    Hi all

    I have a table of orders, where a serial number can be booked with different number several times over several days.

    Requirement is to bring the last order (based on the date of creation) number associated with this serial number and just previous order number and data in the format below.

    Last order numberSerial numberReservation locationNo bookingPrevious order numberSerial numberReservation locationNo booking

    It is essentially to generate the report that a reserved serial number with how many times with different orders and report must contain details of order two in a line.

    Kind regards

    You asked for the last line, and you have not provided data of the example or the expected results, so you get what you asked for.

    You may be looking for data to be partitioned on another value, for example

    SQL > ed
    A written file afiedt.buf

    1. Select deptno, ename, empno, mgr, hiredate, prev_empno, prev_ename, prev_mgr, prev_hiredate
    2 starting at)
    3. Select deptno, ename, empno, mgr, hiredate
    lag (empno) 4, over (partition by deptno arrested by hiredate) as prev_empno
    lag (ename) 5, over (partition by deptno arrested by hiredate) as prev_ename
    lag (mgr) 6, over (partition by deptno arrested by hiredate) as prev_mgr
    lag (hiredate) 7, over (partition by deptno arrested by hiredate) as prev_hiredate
    8, case when hiredate = max (hiredate) on (deptno partition) then 1 0 otherwise fine as max_hiredate
    9 of PEM
    10       )
    11 * where max_hiredate = 1
    12.

    DEPTNO EMPNO, ENAME MGR HIREDATE PREV_EMPNO PREV_ENAME PREV_MGR PREV_HIRED
    ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
    10 7934 MILLER 23/01/1982 7782, 7839 KING 17/11/1981
    20 7876 ADAMS 7788 23/05/1987 7788 SCOTT 7566 04/19/1987
    30 7900 JAMES 7698 03/12/1981 7654 MARTIN 7698 28/09/1981

    who is the last disc, by Department, as well as the previous within the same Department.

  • Min - Max and the planning of Kanban

    What are the factors or business cases that should be considered in the choice of planning that we should go?
    Any help would be appreciated

    My Client is interested in the above 2 methods

    Thank you
    Mahendra

    It of a broad question and is not easy to answer.
    One major difference is your philosophy.
    Kanban (if properly implemented) is pull based system.
    Min - max is always anxious that is it looks at your current onhand, future demand, future supply and then comes up with a purchase requisition.

    But there is no hard rule.

    Min - max works well when the issue of subinventory is not placed in a compartment. But in a workshop type of situation, you can have an operator goes the CRUDE inventory to get a bucket of screws.
    If you ran min - max on the WIP subinventory, he will think that you have a lot and does not generate a purchase requisition.
    But another operator may require that these screws and it may be out of them. In this case, a Kanban work better because as soon as the first operator took the last nth bucket, Kanban would have triggered the replenishment process.

    Kanban requires you to spend the time to analyze your problems to get to many of bin sizes and locations.

    The general rule is that Min - Max is simpler to implement.
    Kanban is a bit more complicated. So if your organization is not not mature enough or requires a simpler solution, min - max will work better.

    Sandeep Gandhi

  • Extremely slow camera in MAX and the software response

    I am in the process of upgrading from a piece of test equipment that uses two firewire cameras.

    Currently, the software is written in LabVIEW 7.1, it uses NEITHER IMAQ and is quite catchy, with little perceptible delay in the passage between the cameras in the software. Same MAX opens up the cameras relatively quickly and you can turn on or take a few seconds of clicking cameras and quickly change between cameras.

    Without changing the external hardware to the computer, but with a new windows 7 PC in place and update the software to use OR-IMAQdx simply by replacing the IMAQ works with IMAQdx in 2014 of LabVIEW and install the latest version of MAX led the software becomes unusually slow in the passage of the cameras. When I say exceptional, I mean that it takes up to 30 years to set up and run each camera. Bearing in mind that the vision process takes 0.5 seconds or less is unacceptable. It is just as painful changing between cameras in MAX.

    I noticed that on another system that uses a camera USB 3, simply by clicking on the camera icon in MAX takes a LOT of time answering to allow you to do anything.

    On the old windows PC with MAX 5 and IMAQ clicking a camera brings the dialog boxes fairly quickly.

    Someone has an idea, what happens? Is it something IMAQdx? Of course, this is not normal?

    Can anyone offer advice please?

    Thank you

    Your post, I shared with my colleague FireWire camera (which is out of town, but regularly check the email), and here's his reply:

    Three cameras at 25 frames per second, with RGB channel separated because of the bandwidth.  We take avi and pngs simultaneously on several channels.  My suspicion is that their former Council might not be fully compliant with the standards. Not all the work of commissions, I tried a little on-site, then chose the one that is recommended by the seller.  In addition, no hubs as they can also stifle bandwidth.

    Hope it will be useful.

    Bob Schor

  • How to get the last row and the sum of all columns in a query

    Hello

    is there a way to get the last record for a column and the sum of all the Archives to another column in the same query.

    Best regards

    You must set your needs correctly volunteers to help here...

    Your data are not good enough to bring you a precise solution. Purpose, you do not have a column, which draws a distinction between the first and the last entry.

    The solution becomes easy based on your design.

    I introduced a grouping called 'id' column and a time column called 'time_of_insert' (only this way you can say with confidence that you can differentiate between the first and last (also a foolproof solution) - you can possibly use sequence (instead of date but if you say that you can insert two lines at the same time) ((and then likely sequence would be a better choice to differentiate instead of a timestamp field) etc...)

    With your sample data, something like this can be done to get the desired results.

    -----------------------------------------------------------------------------------------------------------------------

    WITH dataset AS

    (SELECT 1 id, 10 used, 8 remain, systimestamp + 1/24 time_of_insert FROM DUAL

    UNION ALL

    SELECT the 1 id, 1, 7, systimestamp + 2/24 FROM DUAL

    UNION ALL

    SELECT the id 1, 2, 5, systimestamp + 3/24 FROM DUAL

    UNION ALL

    SELECT 1 id, 1, 0, systimestamp + 4/24 FROM DUAL

    UNION ALL

    SELECT 1 id, 0, 0, systimestamp + 5/24 FROM DUAL

    UNION ALL

    SELECT the 1 id, 1, 4, systimestamp + 6/24 FROM DUAL)

    SELECT *.

    (SELECT SUM (used) ON sum_all)

    FIRST_VALUE (stay)

    COURSES (PARTITION BY id ORDER BY time_of_insert DESC)

    last_row

    Of THE dataset)

    WHERE ROWNUM = 1;

    Output:

    ------------------------

    SUM_ALL LAST_ROW

    ------------------------------

    15                  4

    See you soon,.

    Manik.

  • In the Add-ons Manager, the "Get Add-ons" button makes me nothing else than a "loading" legend that lasts forever. and the "Extensions" button makes me a white screen;

    In addition to the foregoing, the aspect button gives the message "Default is incompatible with Firefox 23.0." I only have one flaw: 21.0. NoScript representative insists on the fact that this problem has nothing to do with Noscript. This leaves only Firefox. Specifically, [email protected] indicates "NoScript has nothing to do with these symptoms, which fit in better with a corrupted profile.
    Please ask for assistance at http://support.mozilla.org.

    You should see the default theme 23.0 listed under appearance.

    As a test, you can try adding a Persona (light theme) temporarily to see if it shows.

    Quote: "default value is incompatible with Firefox 23.0." I only have one flaw: 21,0.

    This seems to indicate that you have Firefox 23.0, but for some reason some will still have a previous version of Firefox 21 files.

    So it is possible that something has gone wrong with a recent update and you have files that do not have updated correctly or the extension registry is damaged.

    The first can be fixed by a clean reinstall, and the second by deleting files (extensions.sqlite, extensions.ini) extensions.* and compatibility.ini in the Firefox profile folder.

    If you see disabled extensions or is not compatible in ' Firefox/tools > Modules > Extensions ' and then click the Tools button, on the side of the left end of the search bar to check if there is an update available compatibility.

  • Speed max and the capacity of RAM of Pavilion dv6

    Hi guys,.

    I don't know, you have been asked before, but each post I find little answers my question, but not exclusively:

    What is the maximum speed and the RAM capacity can put in my Pavilion dv6 (Beats edition)? Completely factory standard

    I want the fastest and most large amount of RAM I can get (I'll make heavy photo editing) and then I put a SSD in as well?

    HP Pavilion dv6 Notebook PC

    Windows 7 Home Premium 64-bit Service Pack 1

    Intel Core i3 - 2330 M CPU @ 2.20 GHz

    RAM:

    Slot 1: 2 GB SODIMM Hynix 1333 MHz

    Slolt 2: 4 GB SODIMM Samsung 1333 MHz

    Radeon (TM) HD 6490 M

    Motherboard: 17F9 10.5 A

    BIOS: F.1B

    Sincere greetings

    Justin

    You are the very welcome, Justin.

    Yes, that's correct. 2 x 8 GB PC3-10600 memory.

    Memory will not run any more quickly than the FSB of the processor. Your CPU FSB is 1333 MHz.

    For example: If you have installed 2 x 8 GB PC3-12600 (1666 MHz) memory, he would go only to 1333 MHz.

    I don't think that there is no outside but except DDR5 memory in video cards.

    But you can not mix DDR memory types, because they work with different voltages and the notches are cut at different places on DDR, DDR2, and DDR3 memory modules to prevent someone to install the bad memory in the PC and damage memory, motherboard or both because of the different voltages they run on.

    Best regards

    Paul

  • Interface user tuner and the percentage of battery missing

    Hi, I turned on tuner UI on Marshmallow and after for its navigation tools and reaching their functions, I decided to turn it off at the time once again, to my surprise the battery % icon disappear in the battery bar. any solucions? I can't find to allow it without the tuner to the system but it worked without it before I used the system tuner.

    1 settings
    2. display
    3. system icons
    4. battery percentage

  • Cisco-AIR-SAP3702I-A-K9, max and the degradation of bandwidth users?

    Hello

    Sorry if somone is asked this question before, but I was unable to find the answer or by mail.

    So here's the intro:

    Symthom:

    I installed and config with a 1240 AP G base still running the office to provide wireless connectivy, but users complain its slow.

    Note: I went to check the PC users and a simple website with some pictures or even to test the connection speed, it is so slow

    Action:

    I changed the AP with a new AIR-SAP3702I-A-K9, just basically, I copied and pasted the config by applying appropriate measures, like changing the fastethernet gigaethernet, etc..

    It has improved a little, but I followed the PA and there are 3 SSID. each SSID was like around 6 users, for a total of 18 users.

    Results:

    Sound still give the same results, he suddenly became so slow but sometimes its execution by the customer well, but relatively slow always.

    ******************************************************************************************************************************************************

    Additional information and troubleshooting of the measures taken:

    We have 100 Mbit/s, so its quite a lot of bandwidth and we use even to an all-time high of the day around 35Mbps. I went to test my PC local, changed to vlan and use the same vlan as the SSID to establish a speed test and I got about 98 MB/s and ping results is 2ms.

    So that tells me that it is not the internet connection I have download file size of 2 GB in a couple of minutes cable using the same subnet, but in the wireless, it says it will take 2 hours to download a file of 200 MB in size.

    I know that it is a shared, but I need more information that I'm not an expert in configuration or give a good explanation as to why the wireless is so slow.

    I'm always conflicted with my classmates because they say that it is the access point, and that I should try only on PC wireless on the AP and check the results of the bandwidth.

    They say I should get 100 Mbps

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    Help in the following:

    Who can tell me what is the maximum number of clients by this type of device (3700 AP series) or recommended?

    Can what kind of measures I take to reduce this problem?

    Who can tell me what is the bandwidth usage max for this AP?

    They are correct, as if the AP with a connected users, should get the same huge amount of bandwidth or would be less?

    Is it true that if a user is streaming and others want to suft normally, it will reduce the bandwidth?

    What is the bandwidth max an AP can use or by customer taking into account that we have 100 Mbps?

    Location: it's just a simple room with the inside AP, nothing special.

    I've included the AP basic config. Any additional info, please let me know,

    Here is the test that I made using the local wired in the same subnet as the SSID and I get good bandwidth.

    Thank you very much!

    Hi Alex,

    1. first of all, a rule, you can use 25 users in a single (). If there is a normal traffic such as e-mail...).

    First troubleshooting:

    you use wpa version 1 for all SSID. You must use WPA version 2 to get 802.11n rates (Higher).

    So I'm changing your configuration, please check.

    Concerning

    Remember messages useful rates

  • Pavilion dv7-6b32us - max and the type of RAM I can install it?

    Hello

    For the pavilion dv7-6b32us, which is the type and maximum RAM I can install?

    The manual says it can go up to 16 GB, but I don't see that 8 GB (4 x 2) available for sale in the world.  We do not know also what type I need.

    Thank you...

    Hello

    Please check this:

    http://www.crucial.com/upgrade/HP+-+Compaq-memory/Pavilion+dv7+series/Pavilion+dv7-6b32us-upgrades.html

    You can buy from them or use the information to buy elsewhere

    Kind regards.

  • Last copies and the latest updates

    When a more recent copy of windows is released on the market, the fact that the copy is up-to-date with the latest updates?

    Not literally, no. For example, Win7 went RTM (Released to Manufacturing) end of July 2009 but Win7 computers were not accessible to the public until end of October 2009. Earlier in October 2009, MS released two 2 critical updates and important updates to 4 four for Win7. CF. http://www.microsoft.com/technet/security/bulletin/ms09-oct.mspx

    ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • Last updated and the AMD Chip

    I was part of the people when updating awhile back it would not work because of me having an amd processor. I had to revert to a previous version to get pp to work. Has that been fixed? I want to upgrade to the latest version to take advantage of the proxy feature. What I want to know is - this security update to the latest version with an amd processor?

    Thank you

    Rchjr

    Thanks Jim,

    I've updated and everything seems to work very well.

    Thank you

    RCHR

  • I installed the last AE and the bridge, but the bridge will not start.

    I'm going to 'Effect/Presets' > 'Browse Presets', but get the error: "the bridge is not installed.  "Go to www.creative.adobe.com/apps and install this feature.

    [Left the lounge general Forum, troubled for a specific product - Mod support forum]

    This problem is fixed in update fixes after effects CC 2015.3 (13.8.1). This update, available now, can be installed by using the creative Office Cloud app, or by choosing Help > updates within any Adobe application.

Maybe you are looking for