We help IT Professionals succeed at work.

What's wrong with this inner join query?

Bruce Gust
Bruce Gust asked
on
Here's my query:

select registration.email, registration.id, songwriting_receipts.contestant_id, songwriting_receipts.contest_end_date from registration inner join on songwriting_receipts.contestant_id = registration.id";

The message that I keep getting is:

1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on registration.id = songwriting_receipts.contestant_id' at line 2

I've played with it and I can't figure out what I'm missing. Thoughts?
Comment
Watch Question

Project Architect
BRONZE EXPERT
Commented:
you are missing the second tablename ...

  from registration inner join songwriting_receipts
    on songwriting_receipts.contestant_id = registration.id
Bruce GustPHP Developer

Author

Commented:
Got it!

Thanks!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.