Matthew.learn Matthew.learn - 1 year ago 65
SQL Question

Discrepancy in SQL result when joining tables

I'm trying to write a query that will return all movies in SAKILA database that have french as the original language. The expected result is 0 rows.

When I use

to find titles with french as the language, I get the expected result:

SELECT title, release_year FROM WHERE language_id =5;

I'm trying to get this result without using literals
, and instead joining the two tables to select the film's original language.

When I write:

SELECT title, release_year
FROM, sakila.language
WHERE = 'french';

I get all rows.

Answer Source

In case you don't want to use join, you need to add one condition inside where.

SELECT title, release_year
FROM, sakila.language
WHERE = 'french' and film.language_id =
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download