Query needed

oracle India
  • 14 years ago

    I am very new to this

    i need a query to retrive the Employees Names and their manager name(based on mgr number)

  • 14 years ago

    The following query is based upon two tables as follows:

    emp_num                   Integer         Key
    emp_first_name         VarChar2(20)
    emp_surname            VarChar2(25)
    man_num                   Integer         Foreign Key

    man_num                   Integer         Key
    man_first_name          VarChar2(20)
    man_surname             VarChar2(25)

    SELECT tblEmployees.emp_first_name, tblEmployees.emp_surname, tblManagers.man_first_name, tblManagers.man_surname
    FROM tblEmployees, tblManagers
    WHERE tblEmployees.man_num = tblManagers.man_num
    AND tblEmployees.man_num = 1

    This will return all employees of manager number 1

    Without meaning to sound rude, when posting a problem like this it is helpful to give a thorough description of your tables and exactly what it is that you are trying to achieve, you will get a more detailed response!!!

  • 14 years ago
    thanku for your reply and  i need the query for "emp" table in the sql. for single table only
  • 14 years ago
    vamsy wrote:
    i need the query for "emp" table in the sql. for single table only


    How are we supposed to help you construct a query if you don't give a detailed explanation of the fields that your table contains, their datatypes and the fields you want to extract with the query?

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Better train people and risk they leave – than do nothing and risk they stay.” - Anonymous