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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:59:42+00:00 2026-05-14T04:59:42+00:00

I have two tables: Contact (id,name) Link (id, contact_id, source_id) I have the following

  • 0

I have two tables:

Contact (id,name)
Link (id, contact_id, source_id)

I have the following query which works that returns the contacts with the source_id of 8 in the Link table.

SELECT name FROM `Contact` LEFT JOIN Link ON Link.contact_id = Contact.id WHERE Link.source_id=8;

However I am a little stumped on how to return a list of all the contacts which are NOT associated with source_id of 8. A simple != will not work as contacts without any links are not returned.

Thanks.

  • 1 1 Answer
  • 1 View
  • 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-14T04:59:42+00:00Added an answer on May 14, 2026 at 4:59 am

    Use:

       SELECT c.name 
         FROM CONTACT c
    LEFT JOIN LINK l ON l.contact_id = c.id
                    AND l.source_id = 8
        WHERE l.contact_id IS NULL
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables: Relationships (ID, UserID, Type, Contact ID) Contacts (ID, Name, Address)
Assume that I have two parent tables: Company and Contact . Assume that both
I have two tables. Contacts table - contact_id, contact_email, contact_name, etc Opt out table
I have two tables: contacts: id, name 1 Alex 2 John documents: id, contactID,
I have two tables, in which one user can have several contacts: User(UserId, UserName)
I have two database tables Contact (Id, Name, ...) and ContactOperationalPlaces (ContactId, MunicipalityId), where
I have two tables Employee (EmpID, Name, UpdatedBy, UpdateDate) EmpContact (ContactID, Contact,EmpID) I am
I have two tables job which contains an attribute called employer_id_job that links it
I have two domain classes (getter setter of two tables): Contact Information and Address
I am using Entity Framework and I have two tables, a contact relationship table

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.