#1
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2013
    Posts
    1
    Rep Power
    0

    Beginner trying to piece together a query to get specific results...insight please.


    I have some data that looks like the below. I am not sure how to make the data pull the MGRNAME, if I can just choose it as a column or if I need something more complex or if it not possible? Any help is appreciated. Thanks.
    select
    Empname,
    Mgrname
    from Table 1


    I have Table1 with fields and data:

    EMPNO EMPNAME MGRNO DEPTNO

    10 EMP10 10

    20 EMP20 10 10

    30 EMP30 10 10

    40 EMP40 20 20



    I need the result:



    EMPNAME MGRNAME

    EMP10

    EMP20 EMP10

    EMP30 EMP10

    EMP40 EMP20
  2. #2
  3. Contributing User
    ASP Skiller (1500 - 1999 posts)

    Join Date
    Mar 2005
    Location
    Columbus, OH
    Posts
    1,665
    Rep Power
    283
    something like that will work

    Code:
    select empl.EMPNAME as EMPNAME,  mng.EMPNAME as MGRNAME
    from Table1 empl
    left join Table1 mng
    on empl.MGRNO = mng.EMPNO
    GK
    __________________________________________________ _____
    if you found this post is useful click Give Rep button (bottom side on this reply ) and agree

Similar Threads

  1. Beginner query question
    By healthstudent in forum Microsoft Access Help
    Replies: 6
    Last Post: June 21st, 2013, 06:20 PM
  2. Beginner Query Problem
    By wjliii in forum SQL Development
    Replies: 1
    Last Post: November 20th, 2009, 03:55 AM
  3. Beginner help with Query...I think?
    By fretwizard in forum Microsoft Access Help
    Replies: 1
    Last Post: January 9th, 2009, 10:28 AM
  4. Beginner's query
    By saggiboy in forum .NET Development
    Replies: 3
    Last Post: June 24th, 2007, 07:47 AM
  5. Beginner...Query Question
    By bostonredsox in forum Microsoft Access Help
    Replies: 0
    Last Post: October 27th, 2004, 12:37 PM

IMN logo majestic logo threadwatch logo seochat tools logo