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

  • SEARCH
  • Home
  • 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 9186773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:36:50+00:00 2026-06-17T19:36:50+00:00

I have this query there I want get all empids’ who didn’t not handle

  • 0

I have this query there I want get all empids’ who didn’t not handle orders on February 12 ,
2008

Select Distinct E.empid, lastname, firstname 
    From HR.Employees as E
    INNER JOIN Sales.Orders as O
    ON E.empid = O.empid 
    Where O.orderdate <> Convert(datetime,'02/12/2008',101)

using NOT IN, EXISTS or set operators is not applicable can somebody get me a genuine solution and explanation also

  • 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-17T19:36:50+00:00Added an answer on June 17, 2026 at 7:36 pm

    One way to do this is to use a left outer join:

    Select Distinct E.empid, lastname, firstname 
    From HR.Employees as E left outer join
         Sales.Orders as O
         ON E.empid = O.empid and O.orderdate = Convert(datetime,'02/12/2008',101)
    where o.orderdate is NULL
    

    If there is a match between employees and orders on the date, then the where clause ignores those records.

    This query is rephrasing your logic. You say “I want get all empids’ who didn’t not handle orders on February 12 , 2008”. The way this works is it actually matches the employees to orders on that date. However, because it uses a left outer join, the match leaves a NULL when there is no match. These are the ones that you want.

    In a sense, this query answers the equivalent question, phrased as “I want all empids that fail to match an order on such-and-such a date.”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my query I want to get all users of the same city. This
I have this question, just in theory. I do some query results and there
I have this sample query: $STH = $DBH->query(SELECT id FROM table); I want to
I have this query which I want to run in my PHP application back
I have this query (notice that all 3 subqueries are selecting different columns from
I have to tables that I want to get all the results of both
Say I have a query like this: one two three, if I replace with
Have this query: SELECT HOUR( DATE ) AS hr, COUNT( * ) AS cnt
I have this query... SELECT Distinct([TargetAttributeID]) FROM (SELECT distinct att1.intAttributeID as [TargetAttributeID] FROM AST_tblAttributes
I have this query which on executing in my sql command line client executes

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.