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

  • Home
  • SEARCH
  • 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 6194725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:20:43+00:00 2026-05-24T03:20:43+00:00

Following on from a previous question about sub-selects, I have an SQL statement with

  • 0

Following on from a previous question about sub-selects, I have an SQL statement with multiple criteria on the join, like so:

SELECT * FROM person
LEFT OUTER JOIN group_membership
  ON person.id = group_membership.person_id
  AND group_id = 1
WHERE group_membership.person_id is null;

Unfortunately, Propel, the ORM I am using with Symfony, doesn’t seem very adept using multiple joins, and previous people have tried to hack criteria together to achieve results. Doing this confused Propel, and it started using CROSS JOINs. From what I’ve read, this was because Propel couldn’t recognise the field ID of the second parameter:

$criteria->addJoin(self::ID, GroupMembershipPeer::PERSON_ID . ' AND ' .
    GroupMembershipPeer::GROUP_ID . '=' . $group_id,
    Criteria::LEFT_JOIN);

I then found the addMultipleJoin() method for Propel 1.4, which appears to work to some extent. I don’t entirely understand it, or how I might call it to get what I desire:

$criteria->addMultipleJoin(array(
  array(
    'left' => self::ID,
    'right' => GroupMembershipPeer::PERSON_ID,
    'operator' => Criteria::EQUAL
  ),  
  array(
    'left' => GroupMembershipPeer::GROUP_ID,
    'right' => $group_id,
    'operator' => Criteria::EQUAL
  ),  
), Criteria::LEFT_JOIN);

This results in some strange SQL:

SELECT DISTINCT FROM `person` CROSS JOIN `group_membership` LEFT JOIN ON (= AND =) WHERE person.ID IN (3,5,17) AND group_membership.PERSON_ID IS NULL LIMIT 10

And PHP is throwing some strange errors:

Notice: Undefined offset: 0 in /path/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/util/Criteria.php on line 675

Does anyone know whether it is myself or Propel doing something wrong, and how I might fix it, or accomplish what I need?

  • 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-05-24T03:20:44+00:00Added an answer on May 24, 2026 at 3:20 am

    Maybe I am wrong, but why are you didn’t use something like this:

    $c->addJoin(array(self::ID, GroupMembershipPeer::GROUP_ID), array(GroupMembershipPeer::PERSON_ID, $group_id) );
    

    Criteria supports multiple join conditions since Propel 1.3. Criteria doc

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

Sidebar

Related Questions

Following on from my previous question [link text][1] , I have a new problem.
Following on from my previous question, Python time to age , I have now
Ok, so following on from my previous question I have ended up with the
Following my previous question , i have a question about why is it this
I have the following code adapted from a previous question/answer: var str = $('title').text();
Following on from my previous question , is it possible to make a Python
Following on from this question I now have code that can attach to a
Following my previous question . I have a table named activity with 2 columns:
Following on from my previous question , I'm looking to run some performance tests
Following on from a previous question relating to heap usage restrictions , I'm looking

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.