MySQL Query help

Hi

I have two tables - cats and manufacturers. Both have primary ‘id’ fields. I need to merge them and so want to find out how many have the same id.

I’ve tried this:

SELECT ‘cats.id’, ‘cats.name’
FROM cats
INNER JOIN manufacturers
ON ‘cats.id’=‘manufacturers.id’

But that returns an emtry set and I know that cannot be correct.

Any ideas. Thanks

According to your query there must be a result set from the both-table( join ).
check manually is there any id is same or not.
Your query seems no error.

look carefully at your ON clause

you are comparing two strings, and they are not equal, so you get an empty result set

now ask yourself why you used strings there

:slight_smile:

i forgot to keep eyes on single quotes.

Off Topic:

Probably a reason they put ’ and ` so far away from each other on the keyboard :wink: