question

megla avatar image
megla asked

Inner join not returning correct column

I have two tables. One is participant, with ID, email address and first name. The second is who2who with ID, leader and follower that determines a leader/follower relationship. Each leader can have multiple followers. I set up the indexing from participant.ID to who2who.leader and who2who.follower.

I wanted to search participant.email for the leader and return the list of participant.email addresses for the followers.

SELECT participant.email_user

FROM participant

INNER JOIN who2who

ON who2who.Leader = participant.p_ID

WHERE participant.email_user = "user@example.com"

What am I doing wrong?

inner join
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Jeff Moden avatar image
Jeff Moden answered

You need to use single quotes instead of double quotes on the string literal in your WHERE clause.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.