Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7760229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:49:40+00:00 2026-06-01T13:49:40+00:00

I’m working with the AdventureWorks example DB – we’re running SQL Server 2008R2, so

  • 0

I’m working with the AdventureWorks example DB – we’re running SQL Server 2008R2, so I assume that’s the edition of AdventureWorks (I have read-only access). I’m trying to get a list of sales managers so that I can then determine a couple employee/manager relationships.
I’m getting two sets of three differently named people, with the same job title, with their CurrentFlag set to 1 (active) with slightly different queries. I do notice that one result group has the same contactID and employeeID, but I’m not sure what this may indicate.

So the question is: Why am I getting completely different results with these two queires? I would think I’d get six results for each – the queries are matching employee table Titles.

  • SQL Query 1:

    select 
       c.FirstName, 
       c.LastName, 
       c.ContactID, 
       e.EmployeeID, 
       e.Title, 
       c.Title, 
       e.CurrentFlag
    from Person.Contact c 
    inner join HumanResources.Employee e
       on c.ContactID = e.ContactID
    where 
       e.Title like '%Sales Manager%'
    
  • SQL Query 2:

    SELECT 
       e.EmployeeID, 
       (c.FirstName + ' ' + c.LastName) as 'First Name and Last Name', 
       e.Title
    FROM HumanResources.Employee e 
    INNER JOIN Person.Contact c
        ON e.EmployeeID = c.ContactID
    Where 
        e.Title LIKE '%Manager%'
        AND
        e.Title LIKE '%Sales%'
    ORDER BY e.EmployeeID;
    

UPDATE: These are my results:

  • SQL Query 1:

    -------  -------  ----  ---  ----------------------------  ----  --
    Stephen  Jiang    1011  268  North American Sales Manager  NULL  1
    Amy      Alberts  1013  284  European Sales Manager        NULL  1
    Syed     Abbas    1012  288  Pacific Sales Manager         Mr.   1
    
  • SQL Query 2:

    ---  ---  -----------  ----------------------------  ---  --
    268  268  Gary Drury   North American Sales Manager  Mr.  1
    284  284  John Emory   European Sales Manager        Mr.  1
    288  288  Julie Estes  Pacific Sales Manager         Ms.  1
    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T13:49:41+00:00Added an answer on June 1, 2026 at 1:49 pm

    The only diffrents i can see is this:

    where 
       e.Title like '%Sales Manager%'
    

    And this:

    Where 
     e.Title LIKE '%Manager%'
        AND
      e.Title LIKE '%Sales%'
    

    The first query says that bring me all titles that has '%Sales Manager%' you can have for ex this output:

    Account Sales Manager
    some Sales Manager
    Sales Manager something else
    

    The second question says bring me all the titles that has '%Manager%‘ and '%Sales%' so you can for ex have:

    Sales Account Manager
    some Sales some Manager some 
    Sales Manager some else thing
    Manager Sales
    

    And this join can not be corrent

    INNER JOIN Person.Contact c
        ON e.EmployeeID = c.ContactID
    

    Don’t you mean:

    INNER JOIN Person.Contact c
            ON e.ContactID= c.ContactID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.