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

    Maximizing Marketing value

    Maximizing Marketing value through Salesforce Datorama Marketing Intelligence and Analytics Tools

    Blog in Salesforce Products

    Salesforce Datorama – With about 7000 marketing technology solutions disrupting the marketing platform, it has been a constant challenge for marketers to get a 360-degree view of…

    Campaign Performance, Datorama Analytics Tools, Marketing Cloud products, Salesforce, Salesforce Datorama
    DemandBlue Mar 22, 2019
    2,597  Views
    Custom Settings in Salesforce

    Learn How to Use Custom Settings in Salesforce

    Blog in Salesforce

    What is Custom Setting? Custom Settings resemble custom items. They are by and large used to make custom arrangements of information and can be related…

    Client, Construction Settings, Custom Arrangements, Custom Fields, Custom Settings
    rajesh andani Nov 9, 2021
    3,909  Views
    Salesforce Flow

    Schedule Your Path in Salesforce Flow | Developer Guide

    Blog in Others, Salesforce

    Advantages of Flow Builder over Process Builder Process builder does work on delete the records Flow work on a different object while Process Builder only…

    API Name, Auto Launched Flow Runs, Auto Launched Flows, Auto Removed, Automated Tasks
    Aditya Jun 25, 2021
    11,949  Views

    Popular Salesforce Videos

    8 Steps to Launch Your App on Salesforce AppExchange

    8 Steps to Launch Your App on Salesforce AppExchange

    Video in AppExchange, Salesforce Apps

    AppExchange is the largest business app store in the world, with over 4,000 apps and millions of users. In this video, we will guide you…

    salesforce, Salesforce Apps, Salesforce App Development, Salesforce Video, Salesforce AppExchange
    ENWAY Nov 6, 2023
    4,033  Views
    Lesser Known VSCode Tips for Salesforce Developers

    Lesser Known VSCode Tips for Salesforce Developers

    Video in Salesforce Stories

    More Code, Less Work. Whether you are a beginner or an advanced developer, smart tips, and sharp tools can significantly improve your productivity. There are…

    Salesforce Training, Salesforce Developers, Salesforce Video, Salesforce Learning, VSCode
    Rupal Kakkar Nov 13, 2020
    1,481  Views
    Future Methods | Asynchronous Apex | Salesforce Tutorial

    Future Methods | Asynchronous Apex | Salesforce Tutorial

    Video in Salesforce Apex

    Asynchronous Apex 1. Future Methods 2. Making callout using future method 3.Avoiding Mixed Dml using Future Method 4. Why sObjects and objects cannot pass as…

    Salesforce Training, Salesforce Tutorial, Salesforce Apex, Salesforce Video, Salesforce Learning
    kanika Jun 16, 2021
    2,220  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.