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 7602787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:30:05+00:00 2026-05-30T23:30:05+00:00

I am trying to write a write and the logic I am looking for

  • 0

I am trying to write a write and the logic I am looking for is basically. If any User IDs from Table 1 do not exist in Table 2 show those in the results. So I did:

SELECT
  UserColder.ContactName,
  UserColder.Phone,
  UserColder.Email,
  UserColder.Website,
  Country.Name,
  UserColderZIP.[ZIP Code],
  UserColderZIP.[State Abbreviation]
FROM
  dbo.UserColder
  LEFT OUTER JOIN dbo.CountryUser
    ON UserColder.ID = CountryUser.[User ID]
  INNER JOIN dbo.Country
    ON CountryUser.[Foreign ID] = Country.ID
  LEFT OUTER JOIN dbo.UserColderZIP
    ON UserColder.ID = UserColderZIP.UserColder
WHERE
  UserColder.ID NOT IN (CountryUser.[User ID])

It returns data without the Where But with the Where I am trying to get it to show all the results where the Id from UserColder don’t have any records in CountryUser. Right now it is returning no results and I know ID 2 doesn’t exist in there. Any idea what I am doing wrong?

Thanks!

  • 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-05-30T23:30:06+00:00Added an answer on May 30, 2026 at 11:30 pm

    Since you have a LEFT OUTER JOIN, to get records from UserColder that don’t exist in CountryUser, check for NULL. The joined rows which have no corresponding value will return NULL.

    WHERE
      CountryUser.[User ID] IS NULL
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write some beforeSave logic in CakePHP 2.0 beta. Basically I want
Im trying to write something to get my images to show correctly. I have
im trying to write an app that will display a list off lines from
I'm trying to write a EditorTemplate to generically apply CSS classes dependent upon logic
I am trying to write values to 2 databases (need not be simultaneously) when
I'm trying to write some custom logic for browsing and searching in a Magento
Thanks for looking into this. Basically, what I am trying to do is to
I'm trying to write a longpolling server with Twisted, but I'm afraid I'm not
I am trying to write the logic for an animation sequence and can't seem
I'm trying to write conways game of life in Java but it's not working

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.