Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8235437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:48:37+00:00 2026-06-07T18:48:37+00:00

Here is my SOQL problem. Query 1: Select c.Date_Joined__c, c.Email, c.FirstName, c.LastName, c.regcode__c from

  • 0

Here is my SOQL problem.

Query 1:

Select 
  c.Date_Joined__c, 
  c.Email, 
  c.FirstName, 
  c.LastName, 
  c.regcode__c 
from Contact c WHERE c.regcode__c ='XXXXXXXXX'

Query 2:

Select 
  p.Account__c, 
  p.Date__c, 
  p.Points__c, 
  p.Description__c, 
  p.Code__c 
from Points__c p where p.Account__c ='YYYYYYYYYYYY' and (p.Points__c > 0) 
Order by p.Date__c DESC

The relationship between the two queries is that c.regcode__c will have the same value as p.Code__c.

I want to combine Query1 and Query2, so c.regcode__c = p.Code__c

I’m stuck, I can’t seem to get the syntax right for SOQL.
Is it even possible to do joins in the API?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T18:48:39+00:00Added an answer on June 7, 2026 at 6:48 pm

    You can’t really create a join per se but you can do some filtering using a syntax similar to this:

    SELECT Id FROM Contact WHERE c.RegCode__c IN (SELECT p.Code__c FROM Account)
    

    As long as the subquery in the WHERE clause is only returning a single value and codes is a filterable field this should work. Also, this doesn’t work if you were trying to filter by the same object (i.e. Account to Account). You can add more criteria to the account side to match your example queries.

    Again, this isn’t a true join so you can’t put the account fields from your subquery. But you can at least filter down your contacts.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my query: SELECT * FROM [GeoName] WHERE ((-26.3665122100029-Lat)*(-26.3665122100029-Lat))+((27.5978928658078-Long)*(27.5978928658078-Long)) < 0.005 ORDER BY
Here's a query that works fine: SELECT rowid as msg_rowid, a, b, c FROM
I'm having trouble getting the results I want from a Salesforce/Apex/SOQL query. I want:
Here's my proposed (very simplified to illustrate the problem space) design for a C#
Here is a complete example. I want to forbid using A::set from objects casted
I'm trying to write a SOQL query to retrieve some Salesforce Content records and
Here is my problem : I have a post controller with the action create.
Here is the problem I'm trying to solve for my game. I have this
Here's a dump of the stats provided my mod_pagespeed from one of my sites.
Here is my problem. Our tech. writer or customer service will often create new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.