Toggle Side Panel

  • Home
  • Articles
    • All Articles
    • Blogs
    • Videos
    • Infographics
  • Consultants
    • Salesforce Product Expertise
      • Top Salesforce ConsultantsTop Salesforce Consultants
      • Marketing Cloud ConsultantsMarketing Cloud Consultants
      • Service Cloud ConsultantsService Cloud Consultants
      • Experience Cloud ConsultantsExperience Cloud Consultants
      • Analytics Cloud ConsultantsAnalytics Cloud Consultants
    • Salesforce Industry Expertise
      • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
      • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
      • Health Cloud ConsultantsHealth Cloud Consultants
      • Commerce Cloud ConsultantsCommerce Cloud Consultants
      • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
    • Salesforce Experts by Location
      • USATop Salesforce Consultants in USA
      • IndiaTop Salesforce Consultants in India
      • AustraliaTop Salesforce Consultants in Australia
      • United KingdomTop Salesforce Consultants in UK
      • CanadaTop Salesforce Consultants in Canada
  • Webinars
  • Marketplace
  • Advertise With Us
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Home
    • Articles
      • All Articles
      • Blogs
      • Videos
      • Infographics
    • Consultants
      • Salesforce Product Expertise
        • Top Salesforce ConsultantsTop Salesforce Consultants
        • Marketing Cloud ConsultantsMarketing Cloud Consultants
        • Service Cloud ConsultantsService Cloud Consultants
        • Experience Cloud ConsultantsExperience Cloud Consultants
        • Analytics Cloud ConsultantsAnalytics Cloud Consultants
      • Salesforce Industry Expertise
        • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
        • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
        • Health Cloud ConsultantsHealth Cloud Consultants
        • Commerce Cloud ConsultantsCommerce Cloud Consultants
        • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
      • Salesforce Experts by Location
        • USATop Salesforce Consultants in USA
        • IndiaTop Salesforce Consultants in India
        • AustraliaTop Salesforce Consultants in Australia
        • United KingdomTop Salesforce Consultants in UK
        • CanadaTop Salesforce Consultants in Canada
    • Webinars
    • Marketplace
    • Advertise With Us
    • Contact Us
    • Discussions
    Close search

    Activity › Forums › Salesforce® Discussions › SOQL to find Accounts without Contacts AND Opportunities in Salesforce

    Tagged: Account, Dynamic SOQL, Salesforce Customization, SOQL

    • Salesforce® Discussions

      SOQL to find Accounts without Contacts AND Opportunities in Salesforce

      Posted by Radhakrishna on August 21, 2017 at 4:05 AM

      I am looking for help to run a Join Query to find all out Accounts in our Database without Contacts AND Opportuntiy. I can run the query indepetly, but I would like to join the queries.

      The Query I am runing to find Accounts without Contacts: Select Id, Name From Account Where Id NOT IN (SELECT AccountId FROM Contacts)
      Query to find Accounts without Opportunties: Select Id, Name From Account Where Id NOT IN (SELECT AccountId FROM Opportunity)

      Shaharyar replied 8 years, 3 months ago 2 Members · 1 Reply
      • Account
      • Dynamic SOQL
      • Salesforce Customization
      • SOQL
    • 1 Reply
    • Shaharyar

      Member
      August 21, 2017 at 5:37 AM

      Hi Radakrishna,

      Use this

      Select Id, Name from Account where ID NOT IN (Select AccountId from Contact) AND ID NOT IN (Select AccountId from Opportunity)

    Log In to reply.

    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me

    application solution

    Popular Salesforce Blogs

    Salesforce CPQ

    How Salesforce CPQ Software Eliminates Sales Hurdles?

    Blog in Salesforce, Salesforce Tools

    In this era of an automated CRM solution like Salesforce CPQ, if your sales team is still struggling in generating quotes, writing proposals and closing…

    automated CRM Solution, Automatic e-signature Integrations, Complex Products, Complex Sales, Configuration
    Ato Sep 29, 2021
    2,599  Views
    lightning record

    Working and Usage of lightning:recordEditForm | Salesforce Developer Guide

    Blog in Lightning

    Build a form with the lightning:recordEditForm component to add a Salesforce record or change fields in an existing record. The part shows fields along with…

    Change Fields, Creating a Record, Customizations, data, Developer Guide
    Marziya May 28, 2021
    10,222  Views
    Salesforce Health Check

    All About Salesforce Health Check 101

    Blog in Others, Salesforce

    If you are a Salesforce admin, your major worry must be security. You will be extra cautious as you are handling customer data and yes,…

    Base Standards, Baseline Control Menu, Central Security System, Compromise Data, Configured by Admins
    Cloudideas Apr 1, 2021
    7,302  Views

    Popular Salesforce Videos

    Salesforce Consultant Career | Salesforce Career Path | Salesforce Consultant Certification

    Salesforce Consultant Career | Salesforce Career Path | Salesforce Consultant Certification

    Video in Salesforce Certifications, Salesforce Consultant

    If you're interested in becoming a Salesforce consultant, one of the first things to consider is how much education you need. We've determined that 60.2%…

    Salesforce Training, Salesforce Certification, salesforce consultants, Salesforce Video, Salesforce Learning
    Rupal Kakkar Jan 5, 2021
    1,286  Views
    Salesforce DX simplified with AutoRABIT - Bay Area Salesforce Developer Group

    Salesforce DX simplified with AutoRABIT - Bay Area Salesforce Developer Group

    Video in Salesforce Implementation, Salesforce DX

    A common need that teams developing on the Salesforce platform express is the desire for a single solution that will take their developers through the…

    Salesforce Release Management, Salesforce Continuous Integration, Salesforce Git Integration, Salesforce Svn Integration, Salesforce Test Automation
    Pooja Jan 17, 2018
    2,014  Views
    CEPTES’s successful visit to Dreamforce’17

    CEPTES’s successful visit to Dreamforce’17

    Video in Events

    Thank you all to those who visited CEPTES at Dreamforce’17. It had been a great event and CEPTES would like to offer gratitude to our…

    dreamforce, salesforce, CRM, DF 17, DF 2017
    CEPTES Jan 10, 2018
    1,397  Views
    Footer Forcetalks logo

    support@forcetalks.com

    • twitterx

    Quick Links

    Advertise with Us

    Salesforce® Articles

    Dreamforce 2023

    Top Salesforce® Bloggers 2023

    Top Salesforce Consultants

    Get Listed

    Company

    Contact Us

    About Us

    Privacy Policy

    Terms & Conditions

    InsightHub

    Salesforce Blogs

    Salesforce Videos

    Salesforce Groups

    Salesforce Jobs

    © 2025 - Forcetalks ● All Rights Reserved

    Salesforce® is a trademark of Salesforce® Inc. No claim is made to the exclusive right to use “Salesforce”. Any services offered within the Forcetalks website/app are not sponsored or endorsed by Salesforce®.

    Try AuditMyCRM - It is a Salesforce CRM Audit tool which comprehensively scans your Salesforce org and gives you the list of errors or warnings you need to take care of.
    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.