Is this MySQL query a JOIN, a regular query or both?

Grace

New Member
I need to get data from 3 different tables. I know the basics about JOINs but when it comes to more complicated queries like getting data from 3 or more tables using JOIN I get a little confused and I just start playing with the queries writing what make sense to me, like the next one:\[code\]SELECT movies.imdbID, movies.title, movies.year, movie_ratings.votes, movie_ratings.total_value, movie_ratings_external.votes, movie_ratings_external.total_valueFROM movies, movie_ratings_externalLEFT JOIN movie_ratings ON movie_ratings.imdbID = movie_ratings_external.imdbIDWHERE movies.imdbID = movie_ratings_external.imdbIDORDER BY movie_ratings.votes DESC, movie_ratings_external.votes DESCLIMIT 30\[/code\]This query works. I get the selected fields from the correct tables and ordered the right way, but I think I'm mixing up things (like regular querying two tables and JOINing between two tables) and I'm sure theres a better/more efficient way to accomplish the same purpouse.Any DB geek available?
 
Back
Top