data query oracle simple summons please help.

Basically, I'm trying to get a number of people on columns. Im having a hell of a time acomplishing can someone throw me a BONE I know there must be a way to do this?
the closest I came to an answer she
is it
select sum(managerCOUNT) manager, manager from 
(
select count(manager) managerCount, count(lead) leadCount, manager, lead from project_1
group by manager, lead 
)group by manager
Here is the table structure and data
create table project_1 ( manager varchar2(250), lead varchar2(250) );
INSERT INTO "PROJECT_1" (MANAGER, LEAD) VALUES ('JAM', 'JAM')
INSERT INTO "PROJECT_1" (MANAGER, LEAD) VALUES ('PMA', 'JAM')
INSERT INTO "PROJECT_1" (MANAGER, LEAD) VALUES ('JB', 'JB')
INSERT INTO "PROJECT_1" (MANAGER, LEAD) VALUES ('SF', 'JB')
INSERT INTO "PROJECT_1" (MANAGER, LEAD) VALUES ('JAM', 'JB')
INSERT INTO "PROJECT_1" (MANAGER, LEAD) VALUES ('JB', 'JAM')
NAME              MANAGER       LEAD
JAM                   2               3 
JB                    2              3
PMA                1               0

etc... you get the idea

Hello

mlov83 wrote:
Basically, I'm trying to get a number of people on columns. Im having a hell of a time acomplishing can someone throw me a BONE I know there must be a way to do this?

Thus, every person, whether a Manager or a lead or both, gets a line?
You probably have a table where there is one line per person, and a foreign key constraint allows you as only denter someone such as a Manager or a lead if they are already in the table. If you do not, you can generate a game on the fly, as I did below, but it's always a good idea to have a separate, real results table.

the closest I came to an answer she
is it

select sum(managerCOUNT) manager, manager from
(
select count(manager) managerCount, count(lead) leadCount, manager, lead from project_1
group by manager, lead
)group by manager

Thanks for posting that! It is always useful to see what you've tried.

Here is the table structure and data

create table project_1 ( manager varchar2(250), lead varchar2(250) );

The LEAD is the name of a built-in function, is not a very good column name. Use something like leader or project_instead.

INSERT INTO "PROJECT_1" (MANAGER, LEAD) VALUES ('JAM', 'JAM')
INSERT INTO "PROJECT_1" (MANAGER, LEAD) VALUES ('PMA', 'JAM')
INSERT INTO "PROJECT_1" (MANAGER, LEAD) VALUES ('JB', 'JB')
INSERT INTO "PROJECT_1" (MANAGER, LEAD) VALUES ('SF', 'JB')
INSERT INTO "PROJECT_1" (MANAGER, LEAD) VALUES ('JAM', 'JB')
INSERT INTO "PROJECT_1" (MANAGER, LEAD) VALUES ('JB', 'JAM')
NAME              MANAGER       LEAD
JAM                   2               3
JB                    2              3
PMA                1               0

etc... you get the idea

With the sample data you posted correct results do not include only 1 row? Which is much easier to say "etc... you get the idea" as saying:

SF               1            0

Here's a way to get the desired results:

WITH   all_people     AS
(
     SELECT     manager          AS name
     FROM     project_1
    UNION
        SELECT     project_lead     AS nmae
     FROM     project_1
)
SELECT       a.name
,       COUNT (CASE WHEN a.name = p.manager      THEN 1 END)     AS manager
,       COUNT (CASE WHEN a.name = p.project_lead THEN 1 END)     AS project_lead
FROM       all_people  a
JOIN       project_1   p  ON  a.name  IN (p.manager, p.project_lead)
GROUP BY  a.name
;

Tags: Database

Similar Questions

  • Automation of data not in Piano roll - Please Help

    I was wondering if someone could kindly help please

    I use an external controller on a keyboard to change things like cut wide in the ES2 when you use a synth.

    After the change in writing Automation data appears in the area of popular songs, but I can't understand how to do so that he can show below the events of midi notes in the piano roll editor and allow me to also change it. I can always change the same midi control function (like cutting) and he appears in the form of empty data not what I recorded and any change overrides greater automation in terms of titles.

    Is there a way to show the recorded data automation in the piano roll allowing me also change please?

    Thanks for any help

    Use the region based instead of track based automation...

    Click on the image if you don't see it animated...

  • SQL query returning no rows, please help!

    I have a table that contains the user checks for a specific procedures alongwith the date stamp. Now, I want the list of all procedures that are not accessible by users in the last 6 months. Or, all of the procedures that have not been used/accessible during the last 6 months.

    That's what I'm trying, but is does not return all rows:

    SELECT DISTINCT proc_name,
    TRUNC (entry_date)
    OF log_web
    WHERE NOT IN (SELECT proc_name proc_name
    OF log_web
    WHERE TRUNC (entry_date) > TRUNC (SYSDATE - 180))
    ORDER BY DESC 2

    Please notify.
    Thank you in advance.

    Hello

    NOT IN never returns TRUE if the subquery returns NULL values. If proc_name doesn't have a NOT NULL constraint, change the subquery to

    WHERE        proc_name     NOT IN ( SELECT  proc_name
                                FROM      log_web
                         WHERE      entry_date     > TRUNC (SYSDATE - 180)
                         AND      proc_name     IS NOT NULL
                          )
    

    I don't see any other suspect.
    Post a small example of data (CREATE TABLE and INSERT statements) where the query produces results worng.

  • I need to remove microsoft winterpack 2004 but can't and I need in simple terms please help

    It is always with the 1713 error code to remove it and I is not that good on Paolo so I need thank you very simple steps

    Hi ChristineHoward,

    1 Windows operating system you are using?

    You can read the following article and see if it helps.

    How to troubleshoot issues that may occur when you install, uninstall, or upgrade one program on a Windows computer

    Hope this information is useful.

  • Tungsten T3 - need to DAT file access with address - please help

    I have an old Palm Tungsten T3. The desktop computer with the address information synchronized died and the T3 has lost power (so no more addresses).

    I have a. Backup DAT files with all my addresses. Can someone tell how can I have access to these.

    Palm Desktop 4.1.4e reinstalling did not help because it does not allow me to import. DAT files.

    Can I import this file into any other application or open in Excel etc.?

    Any advice would be much appreciated.

    Thanks in advance.

    You must physically copy the .dat file in the directory of the user on the existing address.dat file.  Find the one with your short hotsync name (i.e. - C:/Program Files/Palm (or PalmOne) / name of your Hotsync/address) and copy the .dat file.

    Make sure that you copy the file and keep another a safe in the case where something goes wrong.  The existing empty address.dat file will be only about 2 k in size.

    Good luck!

    WyreNut

  • Simple cursor - please help

    Hey,.

    Im trying to do a simple vertical slider.

    It's the code currently im on:

    import flash.events.MouseEvent;

    import flash.geom.Rectangle;

    obj1.addEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler);

    function mouseDownHandler(event:MouseEvent):void {}

    stage.addEventListener (MouseEvent.MOUSE_UP, mouseUpHandler);

    var scrollUpAmount:int = 0;

    var scrollDownAmount:int = 0;

    var boundsRect:Rectangle = new Rectangle(obj1.x,obj1.y-scrollUpAmount,0,obj1.y+scrollDownAmount);

    obj1.StartDrag (boundsRect, true);

    }

    function mouseUpHandler(event:MouseEvent):void {}

    stage.removeEventListener (MouseEvent.MOUSE_UP, mouseUpHandler);

    obj1.stopDrag ();

    }

    but I can't get the cursor to have a value y max, im trying to do the sider to work this way:

    You can drag up or down, with a maximum of 5 units, if the unit value is less then 5 and the mouse is in place, the cursor returns to the unit one.

    If the cursor is at Unit 5 and mouse is in place, the judgment of the cursor and a clip plays, cursor jumps back to 1

    any ideas on how I can get this working? any help is much appreciated!

    THX pavel

    You should think about what you're trying to set up when you use boundsRect.height - obj1.height - 20 as a control value.  You should follow to see if it's what you motivated, it should be.  I noticed that you have the value of boundsRect used in the second function, but it does not work because it said in the first function... it is out of reach for the second function when you declare it inside the first.

    Still, I can't follow what you're trying to do, so I can't do much to solve.  If you are unable to progress further, feel free to start a new assignment and I would avoid it so that someone else might be likely to take a shot at it... attention new validation.

  • I need help for a simple task (Please HELP)

    Hi, you know how you can create a badge and link it to another site with ActionScript in this program? Well I need to know in a way like... to make a button and... Bind it to the next section. OK, here is what im trying to do happen... the user presses a button in the flash program and an apperars comment. then they tap it once and a newcomer to the top... and so on... I do like 50 different frames with new comments on them and then create on each link of weft to the next section. is it possible to do? If there is I REALLY need your help. Please

    Thanks :)

    on (release) {}
    nextFrame();
    }

    the help documentation (F1):

    function nextFrame
    nextFrame(): Void

    Sends the playhead to the next section.

    Availability: ActionScript 1.0; Flash Player 2

    Example of
    In the following example, when the user presses the right or down arrow, the playhead goes to
    the next frame and stops. If the user presses the left or the arrow key, the playhead goes to the
    previous image and stops. The listener is initialized to wait the arrow key to be pressed, and
    the init variable is used to prevent the listener to be redefined if the playhead returns to
    Framework 1.

    Stop();

    If (init == undefined) {}
    someListener = new Object();
    someListener.onKeyDown = function() {}
    If (Key.isDown (Key.LEFT) |) {Key.isDown (Key.UP))}
    _level0.prevFrame ();
    } Else if (Key.isDown (Key.RIGHT) |) {Key.isDown (Key.DOWN))}
    _level0.nextFrame ();
    }
    };
    Key.addListener (someListener);
    init = 1;
    }

    ******************************************
    --> * Adobe Certified Expert *.
    --> www.mudbubble.com
    --> www.keyframer.com

    mybluehair wrote:
    > Hi, you know how you can create a badge and bind it to another site with the
    > actionscript in this program? Well I need to know in a way like... to make a
    > button and... Bind it to the next section. OK, here is what im trying to do
    > happen... the user presses a button in the flash program and a comment
    > apperars. then they tap it once and a newcomer to the top... and so on... I have
    > could make like 50 different frames with new comments on them and then make the
    > on each link of weft to the next section. is it possible to do? If
    > It is I REALLY need your help. Please
    >
    > Thanks :)
    >

  • Formatting dates in a site PHP - please help


    I want to be able to display dates on a dynamic page using PHP in other than yyyy-mm-dd format standard. When I use the recordset object links to select a particular area (fixed in the table as a date type field) and change the format to display a date in the form page is in the correct format, but the date is always January 1, 1970 (for example, January 1, 1970 or on 01/01/1970 etc.). As soon as I put the None format the date returned correctly according to the date indicated in the table, but obviously in the YYYY-MM-DD format.
    Of course, I hurt something basic, but I can't understand my mistake for the life of me.

    The page in question is events.php

    If anyone can spare time to help a desperate soul it would be greatly appreciated.
    Thank you
    Graham

    Iain71 wrote:
    > This is something I'm trying to do as well - what is the best way to change
    > the format for a text input field? I have a form dating from the people collection
    > birth - also using PHP / mySQL.

    MySQL stores dates in a format: AAAA-MM-JJ. attempt to store all
    another format and it will be converted to 0000-00-00.

    The more wisely to deal with this must have three separate entries
    fields for year, month and date. Then use PHP to validate fields,
    Make sure that the date is authentic (in other words, reject the 30, 31, February)
    September, and so forth) and build a string in MySQL format.

    --
    David powers
    Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    http://foundationphp.com/

  • Oracle 10g R2 vs Oracle 10 g; Please help me

    Hi all;
    I'm preparing my first review of the OCA; Oracle Database 10 g: Administration I. I do my preparation for the bulk of 2 books; Sybex book OCA-Exam and all-in-one exam Guide book.
    Both books are based on the first version of Oracle 10 g.
    My questions are:

    -What is the diffrence between Oracle 10 g R2 vs Oracle 10 g R1?
    -What's new in Oracle 10 g R2 (settings, default parameter values, features...)?

    Thank you very much

    Best regards
    W

    Published by: OracleJavaLinux on October 30, 2008 08:01

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14214/Chapter1.htm#NEWFTCH1

    Hope that helps.

  • Menu of Disabeling default Date field... urgent please help

    I use a fild of date but I want to disable the menu item by default it adds when another dialogue with the date is launched and you can scroll amonghts the date.

    a copy of the Date field class

    "The field also adds a menu item to change its value. When it is called, a dialog box appears in which you can use the wheel to change the date without keeping the ALT key. The date all is shown, but only the current field is selected and editable. This dialog box supports the same IRS as the base control. Pressing ENTER or clicking on rejects dialogue and modifies the selection. Pressing on ESCAPE rejects dialogue and cancels the change. "

    I don't want this feature, how can I dissable it?

    Kind regards

    Kaddy

    There are 2 ways you can accomplish this.  The menu item is added only if the DateField is editable.  For example, you could create the DateField with READONLY style.  Alternatively, you can override method makeMenu of the field so that context menu is not added.

  • what my pc my data is safe and blocked please help

    I got a new link up Dsl att modem Dell desktop and what to safe keep, has new Xps 8500 wireless card built in, not of a Wi - Fi router. I found unsecured Wi - Fi signals. How can I make sure that the pc is safe and secure. Please answer soon?

    My pc is new & has been installed by dell

    Hi bofish,

    If the system comes with a wireless card, it detects all networks wireless in range. The unsecured network you're talking about could be your neighbor. Until you use your connection with password on it and security software installed on the system, the connection is secure.

    Answer please if you have any questions.

  • A simple question please help.

    Hello

    I have 2 textfields and a button. I want to enter a number (in diameter) in the first textfield (inputField) and by clicking the button (myButton), I want to get the (circumference) result in the second textfield (inputField1). diameter * 3.14. I know it's a simple question, but it is a very simple mind. Then, have mercy on me.

    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.text.TextFormat;
    import flash.text.TextFormatAlign;
    import flash.events.MouseEvent;

    var inputField:TextField = new TextField();
    var myFormat:TextFormat = new TextFormat();
    myFormat.size = 44;
    inputField.defaultTextFormat = myFormat;
    inputField.restrict = "0-9";
    inputField.maxChars = 6;
    inputField.multiline = false;
    inputField.textColor = 0 x 000000;
    inputField.border = true;
    inputField.width = 150;
    inputField.height = 50;
    inputField.x = 75;
    inputField.y = 50;
    inputField.borderColor = 0xFF0000;
    inputField.type = "input";

    addChild (inputField);


    var inputField1:TextField = new TextField();
    var myFormat1:TextFormat = new TextFormat();
    myFormat1.size = 44;
    inputField1.defaultTextFormat = myFormat;

    inputField1.maxChars = 1;
    inputField1.multiline = false;
    inputField1.textColor = 0 x 000000;
    inputField1.border = true;
    inputField1.width = 150;
    inputField1.height = 50;
    inputField1.x = 275;
    inputField1.y = 50;
    inputField1.borderColor = 0xFF0000;

    addChild (inputField1);


    myButton.addEventListener (MouseEvent.CLICK, fl_MouseClickHandler_2);

    function fl_MouseClickHandler_2(event:MouseEvent):void
    {
    {
    trace ("mouse clicked");

    }
    }

    use:

    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.text.TextFormat;
    import flash.text.TextFormatAlign;
    import flash.events.MouseEvent;

    var inputField:TextField = new TextField();
    var myFormat:TextFormat = new TextFormat();
    myFormat.size = 44;
    inputField.defaultTextFormat = myFormat;
    inputField.restrict = "0-9";
    inputField.maxChars = 6;
    inputField.multiline = false;
    inputField.textColor = 0 x 000000;
    inputField.border = true;
    inputField.width = 150;
    inputField.height = 50;
    inputField.x = 75;
    inputField.y = 50;
    inputField.borderColor = 0xFF0000;
    inputField.type = "input";

    addChild (inputField);

    var inputField1:TextField = new TextField();
    var myFormat1:TextFormat = new TextFormat();
    myFormat1.size = 44;
    inputField1.defaultTextFormat = myFormat;

    inputField1.maxChars = 1;
    inputField1.multiline = false;
    inputField1.textColor = 0 x 000000;
    inputField1.border = true;
    inputField1.width = 150;
    inputField1.height = 50;
    inputField1.x = 275;
    inputField1.y = 50;
    inputField1.borderColor = 0xFF0000;

    addChild (inputField1);

    myButton.addEventListener (MouseEvent.CLICK, fl_MouseClickHandler_2);

    function fl_MouseClickHandler_2(event:MouseEvent):void
    {
    {
    inputField1.text = String (Math.PI * Number (inputField.text));

    }
    }

  • file.data.readUTF (); does not properly, please help me :)

    I downloaded a csv file from google to outlook, but when I try to read it, I get errors. For example if I do this:

    private void completeHandler(event:Event):void {}

    var st:String = file.data.readUTF ();


    After that the st first to lines variables contain something like that


    RST name, surname, name, title, suffix, initials, webpage, sex, birthday, birthday, location, language, Internet + free/busy, Notes, E-mail address, address email 2, email 3, main phone, home phone, home phone 2, Mobile phone, Pager, Home Fax, personal addresses, Home Street, Home Street 2, Home Street 3, home address PO Box, town house, home State, Home Postal Code , Country of origin, spouse, children, manager name, name of the wizard, under the company main phone, work phone, business phone 2, Business Fax, Assistant phone, company, job title, Department, office location, ID number, organization, Profession, account, address professional, street, Business Street 2, Street 3, business address PO Box, Business City, State business, postcode, country company, other Business phone Another Fax, another address, other street, another Street 2, another Street 3, other address PO Box, another city, another State or another ZIP Code, other countries, reminder, car phone, ISDN, Radio telephone, TTY telephone, telex, user 1, user 2, user 3, user 4, keywords, mileage, Hobby, billing information, directory server, sensitivity, priority, private, categories

    ,,,,,,,,,,,,,, [email protected] ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Normal,,,

    where as in the csv file the first two actual lines were:

    First name, middle name, name, title, suffix, initials, Web Page, sex, birthday, birthday, location, language, Internet free, busy, Notes, address e-mail, address 2 E-mail 3 address, main phone, home phone, home phone 2, Mobile phone, Pager, Fax, home, home, Home Street, Home Street 2, Street 3, the home address PO Box, town house , home State, Postal Code home, country of origin, spouse, children, Manager, name of the wizard's name, referred by the company main phone, work phone, business phone 2, Business Fax, phone Wizard, company, job title, Department, office location, ID number of organization, Profession, account, address, street, Business Street 2, Street 3, business address PO Box, Business City, State business, Business Postal Code , country company, another phone, another Fax, other address, other street, another Street 2, another Street 3, other address PO Box, another city, another State or another ZIP Code, other countries, reminder, car phone, ISDN, Radio telephone, TTY telephone, telex, user 1, user 2, user 3, user 4, keywords, mileage, Hobby, billing information, directory server, sensitivity, priority, private categories

    ,,,,,,,,,,,,,, [email protected] ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Normal,,,

    This was bugs me for months

    Wouldn't be file.size?

  • Code 646 error that I tried to install updates KB977304 and KB976416, but they continue to come down can someone please help me.

    Error 646 dates moved KB977304 and KB976416 please help.

    Hello

    You need these updates? They have already installed or do not have the programs what are
    (Windows updates sometimes suggested those who are not needed). If Yes, then go into Control Panel-
    Updates to Windows - click right on and HIDE.

    Try this 1st to see if it helps, and it should:

    Description of the Patch registration cleanup tool
    http://support.Microsoft.com/kb/976220/

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

    If necessary :

    Try this - Panel - Windows Updates - on every update that will not be installed - click on the important updates
    or the update itself - double click a view more information (or click top then discovers on the right)

    Those who will take you to a page where you can download the update.

    Or go here and the KBxxxxxx number to download it.

    Download Center - mount the KBxxxxxx.

    Microsoft Download Center
    http://www.Microsoft.com/downloads/en/default.aspx

    Download - SAVE - go to where you put them - click on - RUN AS ADMIN

    Then you can right click on the update in the updates Windows and HIDE.

    If you get an error Installer install this version:

    Windows install 4.5 Redistributable
    http://www.Microsoft.com/downloads/details.aspx?FamilyId=5A58B56F-60B6-4412-95B9-54D056D6F9F4&displaylang=en

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

    Then run this:

    How to reset the Windows Update components? -a Mr Fixit
    http://support.Microsoft.com/kb/971058

    Description of the system for Windows Vista, Windows Server 2008, update tool and
    for Windows 7
    http://support.Microsoft.com/kb/947821

    ------------------------------------------------------------
    Because these are all Office updates you might get more information if necessary in the Agency of those groups that
    may have experienced the same problem.

    Office newsgroups
    http://www.Microsoft.com/Office/Community/en-us/FlyoutOverview.mspx

    Microsoft.public.office.misc discussions
    http://www.Microsoft.com/communities/newsgroups/list/en-us/default.aspx?DG=Microsoft.public.Office.misc&cat=en_us_01cb749f-c998-4762-8099-df71793c11c7&lang=en&CR=us

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

    If necessary you can incident free get reports however the above should take care of it for you.

    Windows updates - free Incident report

    Go here and click on-> Windows Update fails while searching, downloading or installation of updates
    http://support.Microsoft.com/GP/wusupport#tab3

    The security updates, you can get free support Incident report
    http://www.Microsoft.com/protect/resources/support.aspx

    I hope this helps.

    Rob - bicycle - Mark Twain said it is good.

  • I had saved my old 32-bit computer on a drive and the WD hard drive. I can't throw the disc or hard disk on my new 64-bit computer can you please help

    I had an old computer 32-bit Windows XP Professional

    All files and folders have been saved on the drive hard portable Western Digital and CD.

    I can't open the data in my new computer with Windows 7 Home premium 64 bit preinstalled by the vendor.

    The old computer is down.  I can't access my saved data.

    Can you please help.

    Thank you

    Hey riri,.

    Thanks for choosing Windows and thank you for providing an opportunity to help you.

    According to the description, you have problems to restore backup data from Windows XP to Windows 7.

    What application did you use to back up data?

    Perform the steps from the link below and see if it is resolved.

    http://TechNet.Microsoft.com/en-us/magazine/ee851568.aspx

    Answer to us if you are having problems with the restoration of data or any question of Windows, and we would be happy to help you.

    Good day!

    Hope this information helps.

Maybe you are looking for