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, 7 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

    Schedule-triggered flows

    What are Schedule-Triggered Flows? | The Ultimate Guide

    Blog in Salesforce

    What are Schedule-triggered Flows? Schedule-triggered flows start up at predetermined intervals and let you automate Salesforce activities. Teams can greatly benefit from this kind of…

    API returnTodaysDateFormula, Automation, Contract start/termination dates, Current date, Date data type
    Mayank Apr 27, 2023
    2,079  Views
    appexchange

    Building Apps Using Salesforce AppExchange

    Blog in AppExchange, Salesforce

    Introduction Salesforce AppExchange was launched in 2005. Salesforce AppExchange is an Online Store just like the 'Play store' in Android phones. It is the marketplace…

    App Features, App Licensing, App on AppExchange, App on the AppExchange Market, AppExchange Security Review
    Anuj Sep 7, 2020
    6,146  Views
    Apex Testing in Salesforce

    All You Need to Know About Apex Testing in Salesforce | The Developer Guide

    Blog in Salesforce Apex

    Apex Testing in Salesforce The Apex Testing enables us to write and execute tests for the Apex Code. An important phase of the Salesforce development…

    Apex Test Class, Apex Testing, Apex Testing in Salesforce, Apex Triggers, Batchable Apex
    Harsh Chandra Sep 8, 2022
    2,774  Views

    Popular Salesforce Videos

    Salesforce Careers - Why Consider A Career In Salesforce

    Salesforce Careers - Why Consider A Career In Salesforce

    Video in Salesforce Stories

    This Salesforce Training Video will help you understand about Salesforce, Salesforce market situation, Salesforce job trends, Salesforce career options and how Salesforce is a safe…

    Salesforce Careers, Certified Salesforce Admin, Salesforce CRM, Salesforce Tutorials, Salesforce Admins
    Simplilearn Apr 24, 2019
    2,027  Views
    Welcome to the Partner Marketing Center | Salesforce

    Welcome to the Partner Marketing Center | Salesforce

    Video in Salesforce Products, Marketing

    The Partner Marketing Center (PMC) is your one-stop shop for customizable marketing assets. By logging into the PMC you can easily access, customize, and deploy…

    Salesforce Training, Salesforce Tutorial, Salesforce Partner, salesforce, Salesforce Video
    Pooja Apr 21, 2021
    2,371  Views
    Get a Salesforce Developer Job in 5 Steps | For Freshers | For Admins | For Non-SFDC People

    Get a Salesforce Developer Job in 5 Steps | For Freshers | For Admins | For Non-SFDC People

    Video in Salesforce Training, Salesforce Admin

    In this video, We will be talking about some tips to get your first job as a Salesforce Developer. If you are a recent graduate,…

    Salesforce Training, Salesforce Jobs, salesforce, Salesforce Admins, Salesforce Developers
    Pooja May 1, 2020
    1,836  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

    © 2026 - 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.