4 Replies Latest reply on Dec 21, 2018 4:56 AM by robiin234

    test

    robiin234

      test

        • 1. Re: Help with query/subquery
          Frank Kulash

          Hi,

          3c32cab6-9037-4333-ae79-c9ea1b829ce2 wrote:

           

          select FIRST_NAME,LAST_NAME,HIRE_DATE,SALARY

          from OEHR_EMPLOYEES

          where hire_date > '21/FEB/1998'

          order by hire_date;

           

          Code so far

           

          Requirements

           

          List the first and second letter of first name,last name,hire_date and salary minus 22.1% rounded to the nearest whole number for all employees last name beginning with the character m.

          Also have to be hired after the 21st feb 1998.

          adcending order for hire date

           

          Do i need to use a nested subquery or can someone give me an example in code of how to do something like this.

           

          Appreciate all help

          We don't need no stinkin' sub-query:

          SELECT    SUBSTR (first_name, 1, 2)    AS fn

          ,         last_name

          ,         hire_date

          ,         ROUND (salary * (1 - .221))  AS reduced_salary

          FROM      oehr_employees

          WHERE     hire_date  >= 1 + TO_DATE ('21/FEB/1998', 'DD/MON/YYYY')  -- assuming hire_date is a DATE

          AND       'M'        =  UPPER (SUBSTR (last_name, 1, 1))            -- case-insensitive

          ORDER BY  hire_date

          ;

          This make a lot of assumptions about your data and requirements. (For example: what if a hiredate is entered as 11:00 AM on February 21, 1998.)  If this query doesn't do exactly what youy want, post a little sample data (CREATE TABLE and INSERT statements) and the exact results you want from that sample data.

           

           

          This question doesn;t have anything to do with the SQL Developer front end, does it: it's just a question about how to do something in SQL.  You'll get better results faster if you post question like this in the SQL and PL/SQL Forum:

          SQL & PL/SQL

          1 person found this helpful
          • 2. Re: Help with query/subquery
            robiin234

            Frank you are the man, really helpful

            • 3. Re: test
              EdStevens

              3c32cab6-9037-4333-ae79-c9ea1b829ce2 wrote:

               

              Frank you are the man, really helpful

              So why did you edit your opening post, removing the original content?  If Frank hadn't quoted it in his reply, this entire thread would be junk.  Don't do that.

               

              And, please change your screen name to something uniquely recognizable.  All you '2d21bza5-8125-37751-zb65-b8bz3c718bc1' look the same.

              • 4. Re: test
                Mike Kutz

                EdStevens wrote:

                 

                3c32cab6-9037-4333-ae79-c9ea1b829ce2 wrote:

                 

                Frank you are the man, really helpful

                So why did you edit your opening post, removing the original content? If Frank hadn't quoted it in his reply, this entire thread would be junk. Don't do that.

                 

                And, please change your screen name to something uniquely recognizable. All you '2d21bza5-8125-37751-zb65-b8bz3c718bc1' look the same.

                This is the same guy that "deleted" his/her homework assignment:

                delete pls

                 

                I'll let a moderator take care of this.

                3c32cab6-9037-4333-ae79-c9ea1b829ce2 wrote:

                 

                recreating