Answer the question
In order to leave comments, you need to log in
How to fix this request?
How to fix this request?
SELECT COUNT(*)
FROM joiners_tourdate
JOIN joiners_country on joiners_tourdate.country_id = joiners_country.id
WHERE joiners_tourdate.artist_id = joiners_artist.id
AND joiners_tourdate.country_id = 3
Answer the question
In order to leave comments, you need to log in
Either way
SELECT COUNT(*)
FROM joiners_tourdate, joiners_artist
JOIN joiners_country on joiners_tourdate.country_id = joiners_country.id
WHERE joiners_tourdate.artist_id = joiners_artist.id
AND joiners_tourdate.country_id = 3
SELECT COUNT(*)
FROM joiners_tourdate
JOIN joiners_country on joiners_tourdate.country_id = joiners_country.id
JOIN joiners_artist ON joiners_tourdate.artist_id = joiners_artist.id
WHERE joiners_tourdate.country_id = 3
Because you don't have it ?
Add it to JOIN:
SELECT COUNT(*)
FROM joiners_tourdate
INNER JOIN joiners_country on joiners_tourdate.country_id = joiners_country.id
INNER JOIN joiners_artist on joiners_artist.id = joiners_tourdate.artist_id
WHERE joiners_tourdate.country_id = 3
And what is within this query joiners_artist.id ? What horrible id from joiners_artist table?
How would a pair of tables be specified, and in the condition a third one suddenly appears ... It turns out "a pen is attached to the file, how old is the train driver?" -)
Apparently, for example, the higher select from joiners_artist was lost - then everything will fall into place. Or you need to somehow join the joiners_artist table
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question