• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

LEFT JOIN help

Guest
Apr 23, 2007 Apr 23, 2007

Copy link to clipboard

Copied

Hi there,

Please I know there must be a simple answer, I want to allow members to join committees, so ONE user can have have MULTIPLE committees.

i have set it to look through the committees and put a checkbox beside the ones that a member has selected. It works fine, BUT it is showing all members, rather an a specific one. I have tried WHERE memberID = 'member123" but that only shows the committees that they have already selected.

So i want to loop through the committees and only show where ONE member is currently selected.

Here is my SQL

SELECT
contactidentifier.identifierID,
contactidentifier.identifierText,
contactidentifier_list.contactIdentifier,
contactidentifier_list.identifierListID

FROM
contactidentifier

LEFT JOIN
contactidentifier_list
ON
contactidentifier.identifierID = contactidentifier_list.contactIdentifier;

Any help would be most grateful
TOPICS
Advanced techniques

Views

186

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 23, 2007 Apr 23, 2007

Copy link to clipboard

Copied

LATEST
you can add a subquery to the end of your current query. without knowing your table structures, I can't be sure about getting it right, but it would be something like

and contactidentifier_list.contactIdentifier in
(select contactIdentifier, count(contactIdentifier)
from contactIdentifier_list
group by contactIdentifier
having count(contactIdentifier) = 1)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation