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

    Top 5 Salesforce TrailheaDX 2020 Keynotes Highlights

    Blog in Salesforce Trailhead

    Hello, enthusiasts, we are thrilled to bring you the highlights of TrailheaDX 2020. There was a lot of buzz and anticipation surrounding this year’s Trailhead since…

    AWS, Change Set, Core Platform, Custom LWC, Data Management
    DemandBlue Aug 18, 2020
    2,542  Views

    Driving Your Innovation Process With an Ideas Management Software | Salesforce

    Blog in Salesforce Products

    Have you ever thought about how organizations innovate? Well, every innovation was once just an idea and ideas come your way when least expected. The…

    Beta Version, Business, Businesses Value, Customer Community, Customer Satisfaction
    Sukhwinder Singh Aug 26, 2022
    1,907  Views
    Record-Triggered Flows

    All About Record-Triggered Flows in Salesforce | The Salesforce Trailhead Guide

    Blog in Salesforce Apex

    In this blog, we will discuss the topic of Triggered flows. There are three general types of flows:  Screen Flow  Auto launched Flow  Triggered Flow …

    API, Auto Launched Flow, Closed Won Opportunities, Condition Requirements, Configure Start
    bhawana Nov 22, 2022
    2,499  Views

    Popular Salesforce Videos

    Email to Case Advance | Converting Cases from Emails Effectively | Salesforce Tutorial

    Email to Case Advance | Converting Cases from Emails Effectively | Salesforce Tutorial

    Video in Salesforce Products, Salesforce Training

    Email-to-Case Advance is an enhanced version of the Salesforce Email-to-Case functionality that converts customer email to cases. It works for Salesforce Service Cloud and provides…

    Salesforce Training, Salesforce Tutorial, Salesforce Service Cloud, salesforce, Salesforce Video
    Sushmita Mehta Apr 5, 2022
    2,844  Views
    Summer Internship | Career with Salesforce

    Summer Internship | Career with Salesforce

    Video in Salesforce Admin

    This Summer, dive into the ocean of Salesforce with S2 Labs Apply for the much-awaited S2 Labs Summer Internship Program and start accelerating your career…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Video, Salesforce Learning
    S2 Jun 20, 2022
    1,318  Views
    Salesforce Interview | Marketing Cloud Success

    Salesforce Interview | Marketing Cloud Success

    Video in Salesforce Stories, Salesforce Training

    What's it like to learn Marketing Cloud from scratch? Akasia Perran has the answers and in this video, I ask her about her experience starting…

    Salesforce Jobs, Salesforce Developer, Salesforce Marketing Cloud, Salesforce Ecosystem, Salesforce Video
    Nauman Oct 16, 2020
    2,407  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.