How use the value of one column to check the values of another row?How can I prevent SQL injection in PHP?How do you set a default value for a MySQL Datetime column?Can I concatenate multiple MySQL rows into one field?How can I SELECT rows with MAX(Column value), DISTINCT by another column in SQL?SQL select only rows with max value on a columnHow to import an SQL file using the command line in MySQL?SQL- Using a value in one tuple to get a value from another oneQuery to display from multiple tablesHow do I generate a MySQL view such that it show all objects in your heircachyHow can I show that someone is part of a shift that they supervise?

What ways have you found to get edits from non-LaTeX users?

Extreme flexible working hours: how to control people and activities?

I have a problem assistant manager, but I can't fire him

Can Rydberg constant be in joules?

Overlapping String-Blocks

Arriving at the same result with the opposite hypotheses

How do governments keep track of their issued currency?

English word for "product of tinkering"

Implement Own Vector Class in C++

Why didn't Voldemort recognize that Dumbledore was affected by his curse?

Why do some employees fill out a W-4 and some don't?

Which languages would be most useful in Europe at the end of the 19th century?

You have (3^2 + 2^3 + 2^2) Guesses Left. Figure out the Last one

Fixing obscure 8080 emulator bug?

Rebus with 20 song titles

How can I get an unreasonable manager to approve time off?

What speaks against investing in precious metals?

How is John Wick 3 a 15 certificate?

Why we don’t make use of the t-distribution for constructing a confidence interval for a proportion?

How to safely destroy (a large quantity of) valid checks?

Are there any important biographies of nobodies?

Cascading Switches. Will it affect performance?

A IP can traceroute to it, but can not ping

How come the nude protesters were not arrested?



How use the value of one column to check the values of another row?


How can I prevent SQL injection in PHP?How do you set a default value for a MySQL Datetime column?Can I concatenate multiple MySQL rows into one field?How can I SELECT rows with MAX(Column value), DISTINCT by another column in SQL?SQL select only rows with max value on a columnHow to import an SQL file using the command line in MySQL?SQL- Using a value in one tuple to get a value from another oneQuery to display from multiple tablesHow do I generate a MySQL view such that it show all objects in your heircachyHow can I show that someone is part of a shift that they supervise?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I have to create a view that shows employee information for employees who are supervised by female supervisors. I have to display EMP_NUM, EMP_TITLE, EMP_FNAME, EMP_LNAME, and the manager’s employee number,
last name, and title.



The code that I tried only gives me the manager information for Lewis.



Below is a picture of the table EMP.
empTable



CREATE VIEW empSalary AS 
SELECT EMP_NUM007, EMP_TITLE, EMP_FNAME, EMP_LNAME, EMP_MGR,
(SELECT EMP_LNAME FROM EMP WHERE EMP_NUM007 = EMP_MGR),
(SELECT EMP_TITLE FROM EMP WHERE EMP_NUM007 = EMP_MGR)
FROM EMP
GROUP BY EMP_NUM007;









share|improve this question






























    0















    I have to create a view that shows employee information for employees who are supervised by female supervisors. I have to display EMP_NUM, EMP_TITLE, EMP_FNAME, EMP_LNAME, and the manager’s employee number,
    last name, and title.



    The code that I tried only gives me the manager information for Lewis.



    Below is a picture of the table EMP.
    empTable



    CREATE VIEW empSalary AS 
    SELECT EMP_NUM007, EMP_TITLE, EMP_FNAME, EMP_LNAME, EMP_MGR,
    (SELECT EMP_LNAME FROM EMP WHERE EMP_NUM007 = EMP_MGR),
    (SELECT EMP_TITLE FROM EMP WHERE EMP_NUM007 = EMP_MGR)
    FROM EMP
    GROUP BY EMP_NUM007;









    share|improve this question


























      0












      0








      0








      I have to create a view that shows employee information for employees who are supervised by female supervisors. I have to display EMP_NUM, EMP_TITLE, EMP_FNAME, EMP_LNAME, and the manager’s employee number,
      last name, and title.



      The code that I tried only gives me the manager information for Lewis.



      Below is a picture of the table EMP.
      empTable



      CREATE VIEW empSalary AS 
      SELECT EMP_NUM007, EMP_TITLE, EMP_FNAME, EMP_LNAME, EMP_MGR,
      (SELECT EMP_LNAME FROM EMP WHERE EMP_NUM007 = EMP_MGR),
      (SELECT EMP_TITLE FROM EMP WHERE EMP_NUM007 = EMP_MGR)
      FROM EMP
      GROUP BY EMP_NUM007;









      share|improve this question
















      I have to create a view that shows employee information for employees who are supervised by female supervisors. I have to display EMP_NUM, EMP_TITLE, EMP_FNAME, EMP_LNAME, and the manager’s employee number,
      last name, and title.



      The code that I tried only gives me the manager information for Lewis.



      Below is a picture of the table EMP.
      empTable



      CREATE VIEW empSalary AS 
      SELECT EMP_NUM007, EMP_TITLE, EMP_FNAME, EMP_LNAME, EMP_MGR,
      (SELECT EMP_LNAME FROM EMP WHERE EMP_NUM007 = EMP_MGR),
      (SELECT EMP_TITLE FROM EMP WHERE EMP_NUM007 = EMP_MGR)
      FROM EMP
      GROUP BY EMP_NUM007;






      mysql view






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 24 at 18:47









      forpas

      28k4930




      28k4930










      asked Mar 24 at 18:28









      avaaaaalynavaaaaalyn

      1




      1






















          1 Answer
          1






          active

          oldest

          votes


















          0














          You need a self join on the table:



          select 
          e.emp_num, e.emp_title, e.emp_fname, e,emp_lname,
          m.emp_num, m.emp_title, m.emp_fname, m.emp_lname
          from emp e inner join emp m
          on m.emp_num007 = e.emp_mgr
          where m.emp_title = 'Mrs.'





          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55327081%2fhow-use-the-value-of-one-column-to-check-the-values-of-another-row%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            You need a self join on the table:



            select 
            e.emp_num, e.emp_title, e.emp_fname, e,emp_lname,
            m.emp_num, m.emp_title, m.emp_fname, m.emp_lname
            from emp e inner join emp m
            on m.emp_num007 = e.emp_mgr
            where m.emp_title = 'Mrs.'





            share|improve this answer



























              0














              You need a self join on the table:



              select 
              e.emp_num, e.emp_title, e.emp_fname, e,emp_lname,
              m.emp_num, m.emp_title, m.emp_fname, m.emp_lname
              from emp e inner join emp m
              on m.emp_num007 = e.emp_mgr
              where m.emp_title = 'Mrs.'





              share|improve this answer

























                0












                0








                0







                You need a self join on the table:



                select 
                e.emp_num, e.emp_title, e.emp_fname, e,emp_lname,
                m.emp_num, m.emp_title, m.emp_fname, m.emp_lname
                from emp e inner join emp m
                on m.emp_num007 = e.emp_mgr
                where m.emp_title = 'Mrs.'





                share|improve this answer













                You need a self join on the table:



                select 
                e.emp_num, e.emp_title, e.emp_fname, e,emp_lname,
                m.emp_num, m.emp_title, m.emp_fname, m.emp_lname
                from emp e inner join emp m
                on m.emp_num007 = e.emp_mgr
                where m.emp_title = 'Mrs.'






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 24 at 18:53









                forpasforpas

                28k4930




                28k4930





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55327081%2fhow-use-the-value-of-one-column-to-check-the-values-of-another-row%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript