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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:14:53+00:00 2026-06-02T11:14:53+00:00

Details: Basically there are 2 MYSQL tables (contacts and transactions) and need to get

  • 0

Details:

http://screencast.com/t/fTRzyqso

Basically there are 2 MYSQL tables (contacts and transactions) and need to get contactid on the basis of two conditions

  1. Get all the contacts (contactid) where there is no transaction at all
  2. Get only those contacts who has one or more transactions but all of them are with Cancel status.

Help!?

  • 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-02T11:15:00+00:00Added an answer on June 2, 2026 at 11:15 am

    You can actually accomplish this with a simple LEFT join… and look for NULL (not found). By doing a left-join, it gets all records from the left table regardless of a match on the right. So, if we set the join condition to your transactions table SPECIFICALLY for Cancelled = “No”, and we FIND a match, ignore that from the result set. If there are no records in transactions, OR all of them are set to Cancelled = “Yes”, they are excluded from the join condition and will thus be considered “none found”

    select
          c.ContactID
       from
          Contacts c
             LEFT JOIN Transactions t
                on c.ContactID = t.ContactID
               AND t.Cancelled = "yes"
       where
          t.contactID is null
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i would get details from two MySQL tables tables structure as shown table:App |AppID|AppName|AppType|
I have two MySQL queries in my PHP code. Basically I need the two
I don’t want to burden you all with the details, but basically I’m a
Basically I have a table which is used to hold employee work wear details.
Details on fonts: When you have some text in specific font, there's a header
The details of the contacts not displayed properly by using this code. I am
first of all some details: I configured security as below in web.xml view plaincopy
I want to store the details of college courses in a (MySql) database but
Been trying this for quite a while now and I need help. Basically I
Hi there I am having a problem with my form validation, basically the problem

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.