Toggle Side Panel

  • Blogs
  • 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
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Blogs
    • 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
    • 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 9 years 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

    Popular Salesforce Blogs

    Case Study: Empowering Global Pharma Customer Support

    Blog in Salesforce

    Transformative impact of the Salesforce Service Cloud Call Center Solution on enhancing customer support across multiple countries within the pharmaceutical industry. The pharmaceutical industry operates…

    Business Process Transformation, Call Center Solution, Call Control Application, Case Management, Case Routing
    Triple Innovations Oct 5, 2023
    1,542  Views

    Salesforce Free CRM Complete Guide

    Blog in Salesforce

    Managing a growing business with scattered spreadsheets and sticky notes is a recipe for missed opportunities. As businesses scale, the need for a centralized "source…

    Salesforce CRM, salesforcedeveloper
    Dean Apr 13, 2026
    1,541  Views

    Major Benefits of Hiring a Salesforce Consultant

    Blog in Salesforce Consultant

    What is the Market Share of Salesforce? Salesforce's global market share and revenue continue to increase year after year. The company holds a market share…

    Application, Assistance, Benefits, Business Needs, Buying Behavior
    Emorphis May 22, 2023
    1,791  Views

    Popular Salesforce Videos

    Customized Ideas Management on Salesforce Experience Cloud | IdeasPro by Grazitti

    Customized Ideas Management on Salesforce Experience Cloud | IdeasPro by Grazitti

    Video in Salesforce Communities

    Learn how IdeasPro enables you to drive business growth by making the most of ideas on Salesforce communities, in this video.

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Community, Salesforce Learning
    Sukhwinder Singh Jul 29, 2022
    3,502  Views
    How relationship works in Salesforce?

    How relationship works in Salesforce?

    Video in Salesforce Development

    In this video, following things have been explained: How to create relationships in Salesforce? What is the need of relationship between two objects in Salesforce?…

    Salesforce Data, Many to Many Relationship, Salesforce Object Relationships, Salesforce Relationships
    Prafull Nov 1, 2018
    2,434  Views
    3 Easy to Use Salesforce Field Service Dashboards | AblyPro- Live Webinar

    3 Easy to Use Salesforce Field Service Dashboards | AblyPro- Live Webinar

    Video in Salesforce Field Service Platform

    Watch AblyPro's exciting webinar video on Salesforce Field Service Reports & Dashboards. Discover how these powerful tools can drive efficiency and cut support costs for…

    Salesforce Field Service Platform, Salesforce Field Service, Service Cloud Specialist, Reports and Dashboards, Field Service Management
    AblyPro Jul 3, 2024
    706  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®.

    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.