Join with count() question, please help!

Hi all

I have this problem (probably simple) that I can't solve... I have 2 tables (tbl_system_engineer and tbl_task_request) here... (only relevant columns are listed below)

-full_name VARCHAR2

-tr_number NUMBER
-submitted_on_date DATE (date of work was presented)
-ass_comp_date DATE (date of task must be performed)
-closed_date DATE (date of task was officially closed)
-applicant NUMBER (the id of system engineer, the person who created this task)

The request is meant to summarize how many of the tasks of engineers system is as follows:
-"past completion date" - how many tasks have tbl_task_request.closed_date > tbl_task_request.ass_comp_date SYSDATE or > tbl_task_request.ass_comp_date for the engineer
-' The completion Date approach' - how many tasks have a tbl_task_request.ass_comp_date in this month, but not "past date of completion" of the engineer
-The calendar"- how many tasks have a tbl_task_request.ass_comp_date > the end of the month SYSDATE and year

Result set lines are supposed to look like...
'System engineer full name', after the completion date County, approaching County end date, the time count

Help, please!


Welcome to the forum!

This is an example of a Pivot , where you want to GROUP BY a combination of columns and some columns appear different, not different rows as columns.
The way to do that is to GROUP BY the expressions for which you want to tidy and use CASE expressions for others.
For example:

SELECT       e.full_name
,       COUNT ( CASE
               WHEN  r.closed_date     > r.xyz_comp_date
               OR    SYSDATE          > r.xyz_comp_date
               THEN  1
            )     AS overdue
,       COUNT ( CASE
               WHEN  xyz.comp_date     <  ADD_MONTHS ( TRUNC(SYSDATE, 'MONTH')
                                                  , 1
               AND   r.closed_date     <= r.xyz_comp_date
               AND   SYSDATE          <= r.xyz_comp_date
               THEN  1
            )     AS approaching
,       COUNT ( CASE
               WHEN  xyz.comp_date     >= ADD_MONTHS ( TRUNC(SYSDATE, 'MONTH')
                                                  , 1
               THEN  1
            )     AS on_schedule
FROM       tbl_system_engineer     e
JOIN       tble_task_request     r     ON     r.requestor     =
GROUP BY  e.full_name

I do not have the versions of your tables, so I can't really test this. I suspect that some consideration for the NULL values must be added to the conditions of the CASE.
If post you a small example data (CREATE TABLE and only relevant columns, INSERT statements) so people can test their ideas.

Sometimes, especially when the columns are mutually exclusive, it is more simple calculate a value in a subquery, saying which column of output each line is associated with. That the calculated value is then used in the CASE expressions very simple in the main query,

Among the features of this awkward site are ithat ir replaces what he thinks are naughty words with s.  I suspect that it happened in your message.  I guess that all of the columns with * are the same, for which I substituted above.

Tags: Database

Similar Questions

  • My ID apple has been disabled and I can't restore it because I forgot my security question, please help

    My ID apple has been disabled and I can't restore it because I forgot my security question, please help

    I can't update my iphone because it will need for my apple for activation ID. Please help me.

    Contact Apple for assistance with the security of the Apple ID - Apple Support accounts

  • I use xport 360 and I can't put my save game back on the program profile it shows a circle with a cross please help me

    I use xport 360 and I can't put my save game back on the program profile it shows a circle with a cross please help me


    If you try to recover the gamer tag, then I suggest you follow the steps from the link below:

    If this does not work then I recommend you to ask your question here:

    Hope this information is useful.

  • go mini questions please help!

    When I turn on my HP mini computer her talk me to "enter the current password" and after three trys it says "system error fatal vaulted password control failure" with code "CNU9475MH7" Please help me through this form as soon as POSSIBLE. I need the important information on this computer!

    Try to ally.


    3rd letter tiny L.

    4th letter lowercase O.

    7th letter lowercase Q.

    Use this code to go into the BIOS.

    Disable all passwords that are enabled.

    IF demand for CURRENT password using this code.

    REQUEST NEW password just press ENTER.

    If asked to hit just to CHECK password to enter.

    Save and exit.


    I must inform you that these services are not endorsed by HP, and that HP is not responsible for any damages that may occur to your system using these services. Please be aware that you do so at your own risk.

  • master password bios for hp mini 1151 with code 2MC92472WZ please help. THX

    master password bios for hp mini 1151 with code 2MC92472WZ please help. THX


    Try to enter: 74eo7vx7d0

    Kind regards

    DP - K

  • Touch pad questions, please help.

    Laptop HP Pavilion

    Model: 15-n096sa

    Product: F4T58EA #ABU

    OS: Windows 8.1 Home Premium X 64

    I installed Windows 8.1 Home Premium X 64 on my laptop last week, he had originally version 8 is installed when I bought a month ago. Since the upgrade of the OS of my touchpad is no longer allows me to scroll with two fingers or enlarge the pages, use the right click function by tapping with two fingers & also bring up the options in a Sling. All I can do now is to move the pointer and click or double-click with the pad.

    Can someone please help me solve this problem because it drives me crazy?

    Thanks in advance.

    Hello EnergySyndicate,

    Welcome to the HP Forums, I hope you enjoy your experience! To help you get the most out of the Forums of HP, I would like to draw your attention to the Guide of the Forums HP first time here? Learn how to publish and more.

    I understand that you are having problems with certain features of the touch pad doesn't work does not correctly. I think it's a question of settings. I'm you provide a HP support document: use and troubleshooting of the TouchPad and ClickPad (Windows 8) that will guide you in how to adjust settings and ensure that the common gestures of the Touchpad is correctly configured.

    I think that this will solve your problem of Touchpad and allow you to go back to listening to your computer. Thanks for posting on the HP Forums. Have a great day!

  • Facial recognition technology Optimus for T410 questions - please help

    Hi guys, I bought a T410 with NVS 310 graphics card and built-in webcam. Although the battery 9 cells works really well, I always like to save more power using the integrated graphics card Intel in light load. It's supposed to be done using NVIDIA Optimus but I can't ' find it anywhere or how to activate it. Some have said depends on pilots and I did not try that again. Please help for a long time.

    The next question is the software of face recognition, as my friend's Asus laptop has Smartlogon using face. I really enjoy doing on my T but I searched a lot of places and can't find it. I knew he had formerly VeriFace which seems to have stopped developing for Thinkpad. If anyone has this software, please give me the link.

    And once I found a problem with a device called Lexmark X 422, windows 7 reports that it may not start (code 10), I try the new driver and still no use. I have disable (uninstall) it can restore the entire system and now I can't find it in device manager to try to fix it again. My question is what is this device and how to correct these problems?

    Thank you, T rocks!

    Hi and welcome to the forum!

    To Optimus, take a look:-

    Lexmark X 422 was probably your webcam, there is no need to do anything if the machine works fine now.

    Not sure on the recognition of faces, as far as I know there not this feature for ThinkPad.

    I hope this helps.

  • WRT150N questions, Please help!

    So I just moved into my new House and set up my internet. I used my router before without any problem so far. So my problem is that I have this linksys router and a motorola 2210 dsl modem AT & T Eh well, if I run the Ethernet directly from the modem to the computer internet works fine. But once I added the router I can not get a connection. With the connected router, I have all green in all areas on the modem and the router "I should be connected by saying" my wireless devices are showing my hense network I should be able to connect to it. But it always says connection failed... At one point, I even had my office that I was connected to 54 Mbps but still my home page would not load. I have no idea whats wrong. The internet is coming through, my wirelss peripheral are picking up that I have a network but I can not connect unless I'm jacked right at the source. Please help me understand this. (and Yes, everything is pluged in the right way)

    AT & T usually configures their Motorola 2210 to the PPPoE connection for you and use the 192.168.1.x subnet.   With its default settings, your WRT150N also tries to use the 192.168.1.x subnet.  But you can't put the same subnet on the Internet (WAN) and the ports LAN of the WRT150N.  It will be, or does not work at all it will not work properly.

    To fix the problem do the following:

    (1) put your entire network.

    (2) disconnect all other devices WRT150N.

    (3) use of an ethernet cable, the son a computer to one of the four ports LAN on the WRT150N.

    (4) turn on the WRT150N and your computer.

    (5) connect to WRT150N to

    (6) in the WRT150N, replace the "local IP address"

    7) click the 'Save Settings' button and then wait for the screen refresh (3 to 60 seconds).  You will be probably disconnected from the WRT150N.  Don't worry about this.

    Exit 8) your browser and put your entire network

    (9) with an ethernet cable, connect the ethernet port on the Motorola 2210 to the Internet of the WRT150N port.  Leave your computer connected to a LAN of the WRT150N port.

    (10) power of your network.  It should work.

  • weird problem with new screen, please help

    Hello people,

    I hope someone can help. I am using windows 7 Home premium and I hope it is a simple solution that someone has met before. It's just that I don't know how to describe it so can't type into google to find an answer.

    This happens in all programs, Firefox, ms word Opera, basically any window I opened. The bar menu at the top of the screen is a transparent white color and everything works well, but after 50 or 60 seconds, it turns into a transparent, I can still read the Word editing, display etc. file. This is where the scroll wheel on the mouse and what I'm typing stops working. When I type something with the mounted volume, all I hear is a single beep whenever I tap on a button, but nothing is actually typed. Now, all I have to do is click anywhere in the window and it works again, but only for 50-60 seconds. I had to click on the screen twice since I started typing this because when I look at the screen, everything I typed is not there because the menu bar's transparent again while I was typing. Its driving me crazy.

    I don't remember what is a problem before, if it was I would have surely noticed. The only thing that has changed is I had been using my 32 LCD TV as a screen for a long time, but I moved and did not bring my TV with me, so I use the PC came with the computer screen. It's a PC I bought my sister a few years ago so I never used the PC screen that comes with it so don't know if it happened when she or what, she has, she can remember either. I have a updated driver, did not work. Changes the settings in customize and cannot do it helped either.

    Monitor: monitor LCD Compaq CQ1859

    Do I something pressed or clicked on something by accident?

    Is there a setting some part that I forgot?

    I plan to cast the spell by the window, its really annoying.

    Please help guys and ladies.

    Hello salamander.

    Please contact Microsoft Community.

    I can understand the inconvenience caused, be assured that we are here to help with your concern.

    1. What is the model of the computer and do ?
    2. Do you see an error message when the menu bar is transparent?

    Please follow the link below and include a screenshot in your post,

    I suggest you follow the methods below to see if it helps.

    Method 1:

    Clean boot: to help troubleshoot error messages and other issues, you can start Windows by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.  Here is the link for your reference perform the clean boot.

    Important: please go through the section: How to reset the computer to start as usual after a clean boot troubleshooting section of Kb to start the computer to a normal startup after you fix the problem.

    Note: If the problem persists, continue with method 2

    Method 2:

    Check the problem by disabling the Aero transparency feature. Please follow the steps below to disable the Aero transparency feature.

    1. Right-click on a vacuum of space on the desktop and click on personalize.
    2. Click on the link to the color of the window at the bottom of the window.
    3. Uncheck the check box enable transparency to disable transparency and check the issue.

    For more information, aero feature please refer to the link below.

    Note: If the problem persists, continue with method 3

    Method 3:

    A Malware - scanner The Microsoft Security Scanner is a downloadable security tool for free which allows analysis at the application and helps remove viruses, spyware and other malware. It works with your current antivirus software. Please follow the steps below to use the scan to Microsoft Security.

    • Run the scanner from Microsoft from the link below:

    • Click on download now and click Run.
    • Choose complete system scan and wait for the full analysis.

    Important: The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss.

    The above information was hoping to get useful, please return it to us if you need additional assistance.

  • GANYMEDE + question: Please help

    Dear all,

    It is with regard to Ganymede +. I have configured Ganymede + on switch cisco, but it is local user name and password

    for authentication.

    With below configuration on the other switch, works very well with Ganymede + username and password, but not with

    This switch.

    AAA new-model

    AAA authentication login default group Ganymede + local

    AAA authentication login no_login local

    AAA accounting send stop-record an authentication failure

    AAA accounting exec default start-stop Ganymede group.

    orders accounting AAA 15 by default start-stop Ganymede group.

    Default connection accounting AAA power Ganymede group.

    AAA - the id of the joint session

    RADIUS-server host touches 110A101614425A5E57 7

    RADIUS-server application made

    username admin privilege 15 password *.

    line vty 0 4

    transport input telnet ssh

    by default the authentication of connection

    Also, this switch is configured for intervlan routing, with the following configuration and I added address IP Cisco ACS.

    interface Vlan5

    the IP


    interface Vlan20


    IP helper


    interface Vlan60


    REFLXIS_PUNCORE #show Ganymede

    GANYMEDE + server:

    Opening of socket: 33

    Firm grip: 33

    Write-offs of socket: 0

    Socket errors: 0

    Socket timeouts: 0

    Failed connection attempts: 0

    Total packets sent: 33

    Recv packets total: 0

    So please help on the same.

    Hello Eve,.

    the IP address of the server is accessible in 20 Vlan.

    Therefore, the switch will try to connect to the server using the address IP of Vlan20,

    You can fix this in two ways:

    1. change the configuration on the radius server to have an entry with instead of


    2. change the configuration of the switch, adding "ip radius-server source interface vlan 60.

    Please indicate the so useful post


  • Card problems or video driver with a N200, please help!

    I have a lenovo 3000 N200, that's really cool, works even at games very well, including the most recent.

    But, is it normal that the pilot program display for freeze-out in Warcraft 3? He always does that when you access the list of cards in the game and after 3-5 minutes during a real game. It defines the resolution up to 640 X 480 (from 1280 X 800) and in 16 colors. I have to reset it to get it to work. Also, it does the same thing in Spore - if after seeing the pilot written for Spore installed, (that I downloaded from the lenovo site) I have not encountered this problem far. In addition, Second Life stops - Fortunately it does not freeze the drivers. I understand that the model I have is not designed for the game, but if it can run Warhammer 40 k: Soulstorm with graphics settings meduim (on the widescreen) without a lagg I do not understand why it would not be able to manage warcraft 3 - even a m200 express ATi can manage. I mean that a X 3100 to Intel must be much more powerful. (ATi said card lagg with older games like Unreal Tournament)

    I have the latest version of the - official - driver and a Win Xp pro Sp2. I always keep my system updated - register for Essilor, but until this driver has not need sp3 - and cleaned viruses.

    Please help me?

    Ooh, it seems that I was right, my problems stems from the incompatibility of the software.

    Namely the based opengl driver (this igfx something of the file that is in the rror reports I receive).

    I solved the problem with Warcraft 3, you have to click with the right button on the icon of warcraft 3 and type the destination line (just after the second "")-opengl or - swtnl. (or - d3d, nota bene, who has not worked for me)

    Although even now it's not as pretty as on my table top pc, it works fine and farily good graphics.

    I think your problem is similar to mine and is amplified - sort of - by Vista somehow, it seems to cause a more severe software incompatibility.


    I have a Dell Inspiron N4010. Configuration: 1st generation i5 processor with windows 7 home basic 64-bit.

    3 months after the purchase of my laptop, I have updated my Dell webcam central through the applications update service... Shortly after the update, my integrated webcam has started to show problems.


    Shortly after the update of my installed factory Dell webcam central, my integrated webcam has begun to show the problem. webcam was able to start with any application such as Skype or dell central webcam himself. Instead, webcam LED flashes for flicker of a second, and then goes away without any streaming video.  Trying to open it, an error message is displayed: "your webcam can be used by another application. Close the application to launch streaming video".» Initially, the problem was temporary, that is occasionally the webcam began video streaming without any problem, but as the time passed, webcam stopped working almost completely.


    I tried all the solutions mentioned below:

    • I uninstalled the Dell webcam software and reinstalled with the version installed in the factory, supplied on CD with laptop. Uninstalled the webcam via the Device Manager and reinstalled, but without success.
    • I heard that there is a conflict between the Dell face recognition software and dell webcam central. So, I uninstalled the dell face recognition software. After that, the webcam worked for a few days, and there still rebooted problem.
    • I went through various forums online, dell community, customer service, etc. and everything suggested tried but without success. I heard several times that this is not a hardware fault but driver error. Even in a few forums, its says that Creative Technology Limited have not been able to supply webcam drivers compatible with windows 7 64-bit.
    • I even did factory restore my laptop twice, but could not do my webcam works.
    • Then, I decided to format my system and installed windows7 again with the disc that came with my laptop. During this process, I have kept the recovery drive and the untouched OEM disk untouched. I have reinstalled all the drivers in such order as advised by Dell. Despite puts everything in order, I couldn't do my built-in webcam work. More... now I can't even access the Dell factory restore option despite the fact that my recovery disk is intact and it is to have all the files into it!
    • I tried the utility dell online Diagnostics. He could not detect any error webcam!
    • Few days back, I used the dell startup screen diagnostic utility and scanned the built-in webcam to find errors, and my webcam failed in all tests! Here are the screenshots of the tests:



    My problem was. No supported webcam not connected when I ran dell webcam central. No program could access the webcam. Device Manager showed SPECIFIC DEVICE. Camera suddenly stopped working! I had a little more hair when this problem started.

    I have Inspiron N4010 windows 7 Home premium. Are the drivers for the webcam in windows 7, there is no separate drivers available anywhere. with the exception of some XPS models.

    A post in these forums suggests to abolish the plastic around the display bezel. It's simple. Just carefully go around and remove. It is clipped without screws on my system. This gives access to the webcam hardware. I got dell webcam central on-board. (showing no supported webcam connected!). Gently, I tried to disconnect the connector of the webcam. My intention was to disconnect and reconnect. I barely touched and the fire came and windows immediately started to install device drivers. A beep and an icon in the notification bar popped up. A few minutes, I saw my beautiful mug on the screen to my absolute delight.

    Guys, if you have a problem where Device Manager does not recognize your webcam for most probably, this is a hardware problem. The small rectangular plate on which is mounted the webcam is not properly secured by DEll. It is a DESIGN PROBLEM. The Board is located in place on two small round plastic holders without any screws. It can move easily. The bezel plastic when it is installed itself that holds it in place, but not very effective. When you open and close the lid of the screen, especially if you are taking in the middle where the camera you finally loose connector. That's why some messages will tell you what they camera has stopped working suddenly and then started working by himself all of a sudden. When I put the bezel plastic, it snaps into place, I was able to move the camera, and it stopped working again. A little gentle jiggle got running again and its been since.

    It does not matter what version of central webcam you have in windows 7. It runs on windows Vista service pack 2 compatibility mode. (Find WEBCAMDELL2. EXE file under programs x 86-dellwebcam-dellwebcam Central-dell webcam central. Right-click on the file name. Select Properties. Select the Compatibility tab and run this program in compatibility select windows vista service pack 2).

    If in your case even though there might be a software problem. always try this simple 2 minute solution b4 safe spending frustrating days find the drivers and software. Hope this post helps someone. May work on other systems too! Good luck! and thank you to the guy who led me down this path and misery!

  • fusion of forms in question please help

    issue.jpgI have a problem: when I tried to merge forms into one with pathfinder, I lost part of the mountain... Please help me. How can I merge without losing?

    Make transparent traces on the forms of mountain before using 'unit '.

  • Layer Mask question, please help.


    My layer mask does not work, do not know what is happening. I use 4 CS. I want to use the blend effect so I put the photos on a white background. I click on the layer mask on each photo, select the tool brush on the picture but does not work, is either appear black or white when I use the brush paint on it. So not bad, the foreground color should be gray & white based on layer mask, but it appears black & white instead. Please see the screenshot below. Please help, thanks


    Hi, I'm going to try explain your problem.

    In your posted example we see that you have three layers in the layers panel.

    On each layer, we can see, on the left side, there is the thumbnail of the layer, it is a display of the actual image of your layer, then a thumbnail of the layer mask (the white rectangle on the right side).

    A layer mask works as follows: you tell Photoshop to show or hide the actual parts (pixels) of the layer with the grayscale values. Indicates a white pixel on the layer masks Photoshop to display the area of the image with a (non-transparent) full opacity, while tells a black pixel on the Photoshop layer mask to hide the layer completely (0% opacity.) Gray values will therefore partially show the image data.

    But you paint on the document, and you must specify Photoshop if you want to paint on the image (what you did in your example, and you don't want to) or if you want to paint on the layer mask (what you want to do). This indication is called targeting. It is simply done by clicking on the thumbnail of the layer or the layer of your layer mask thumbnail. (By clicking on different areas of a layer in the palette layers are different orders, you give to the program). For example, if you want to move the layer that you hide to another, in order to paint on his mask, sure to click on the layer of the other layer mask thumbnail in the layers panel.

    In Photoshop CS5.5 and earlier versions, you'll see that a layer or its mask is targeted because there will be three contours around her: a black, a white and a black once again, as the actual layer data in the highlight 0928 your image layer. You should see these three contours around the layer mask to paint over it.

    CS6 the target indicator is different, look in my image, we can see that the layer mask is targeted with white corners: I then have the part of the black layer mask by targeting the layer mask in the layer panel and then paint on the image where I want to hide the layer.

    If you want to change the layer (photos, in your case), just click on the thumbnail, and you're ready to go!

    I hope this helps.

    See these help documents: laquerbe Basics: tml

    Layer masks:

    Some the search results for "Masks fundamental layer" in Photoshop help: uct_adobelr & hl = en_US & lr = en_US & auto = 0 & area = 0

    (It is one of the best ways to search for files of tutorials or help)


  • Slaughter of BG sound with another class please help!

    Hey hope someone can shine a light on this for me, been stuggling with that for awhile now.

    I had a background sound to play, which is in a separate category codes:

    Class: screen_Control

    public function randonizer_SND (): void


    var r: int = Math.floor (Math.random () * 17);

    if (r == 1)


    currentBG_SND = snd1_BG;


    if (r == 2)


    currentBG_SND = snd2_BG;


    if (r == 3)


    currentBG_SND = snd3_BG;


    if (r == 4)


    currentBG_SND = snd4_BG;


    if (r == 5)


    currentBG_SND = snd5_BG;


    if (r == 6)


    currentBG_SND = snd6_BG;


    if (r == 7)


    currentBG_SND = snd7_BG;


    if (r == 8)


    currentBG_SND = snd8_BG;


    if (r == 9)


    currentBG_SND = snd9_BG;


    if (r == 10)


    currentBG_SND = snd10_BG;


    if (r == 11)


    currentBG_SND = snd11_BG;


    if (r == 12)


    currentBG_SND = snd12_BG;


    if (r == 13)


    currentBG_SND = snd13_BG;


    if (r == 14)


    currentBG_SND = snd14_BG;


    if (r == 15)


    currentBG_SND = snd15_BG;


    if (r == 16)


    currentBG_SND = snd16_BG;




    public function playSND (): void


    snd_BG_Channel = (0,1);

    snd_BG_Transform.volume = 1;

    snd_BG_Channel.soundTransform = snd_BG_Transform;

    snd_BG_Channel.addEventListener (Event.SOUND_COMPLETE, nextSnd);


    nextSnd(event:Event):void of the public service




    Is what I try to achieve this sound to stop playing when a "button" is linked and then start playing again back in the main screen.

    The "button" is controlled in a different category, and when I try to put a stop function there is to the sound I have the following error:

    1119: access of property may be undefined snd_BG_Channel through a reference with static type class.

    This is the code I use to try to stop the channel:

    screen_Control.snd_BG_Channel.stop ();

    If you have an idea of what I'm doing wrong please help!

    THX pavel

    Did you check this line? public var snd_BG_Channel:SoundChannel;

    Must be:

    public static var snd_BG_Channel:SoundChannel;

Maybe you are looking for