Need help with Retrieving Data

  • Hi All! Please forgive me as I am new to learning SQL; I apologize in advance if my questions maybe a bit "Simple" to those who are experts!

    I also greatly appreciate your assistance and look forward to learning a lot from the Forum Folks here! 🙂

    A friend has been helping me with getting started with learning SQL and I'm working through various scenarios to help build my experience with learning SQL.

    I need to create a report showing the title the first and last name of all sales representatives-

    This is what I have so far but am having difficulty retrieving ONLY the "Sales Representatives" Titles.

    Select Firstname, Lastname, Title

    From Employees

    Where ???

    I'm lost after this!

    I look forward to your assistance! 🙂

  • Sweetbea,

    Maybe you should start by reading this article:

    How to post a T-SQL question on a public forum

    It's impossible to answer your question as stated, because we can't see the table definitions, or inserted records...

    If you can post that, answering should be simple.

  • I'm sorry...I will review and follow up.

    Thank you.

  • Okay this is what I'm running:

    Select FirstName, LastName, Title

    from Employees

    See attached the Results. I need know how to only retrieve records for "Sales Representatives"

    Hope this is enough information. Still trying to get a hang of how everything works here!

  • Sweetbee870 (9/9/2015)


    Okay this is what I'm running:

    Select FirstName, LastName, Title

    from Employees

    See attached the Results. I need know how to only retrieve records for "Sales Representatives"

    Hope this is enough information. Still trying to get a hang of how everything works here!

    Quick suggestion

    😎

    /* Choose the columns to retrieve */

    SELECT

    E.FirstName

    ,E.LastName

    ,E.Title

    /* and the source table(s), remember

    always to use an alias for disambiguation

    if columns with the same name exist in

    more than one table */

    FROM Employees E

    /* search predicates or "fileter" for the

    selection. */

    WHERE E.Title = 'Sales Representatives';

  • Sweetbee870 (9/9/2015)


    Okay this is what I'm running:

    Select FirstName, LastName, Title

    from Employees

    See attached the Results. I need know how to only retrieve records for "Sales Representatives"

    Hope this is enough information. Still trying to get a hang of how everything works here!

    You spent more time creating and uploading the photo that you would have if you had taken the time to post data in a readily consumable format like the article suggests. 😉

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • You are splendid!! I will give this a try! Thank you so much and sorry for the newbie question!! 😀

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply