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
rooftop:
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:
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.
r937
March 28, 2013, 11:11am
3
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
i forgot to keep eyes on single quotes.