Click to See Complete Forum and Search --> : help for code to search tables for something not download in a certain country?


elmo_helper
12-09-2011, 09:38 AM
how do i get it to show the films not downloaded in spain as for example this query returns inception as it was download by someone in france but it was also downloaded in the spain so how do i get it to check for films only spain has not downloaded and return.

SELECT tbl_movies.movie_id, movie_title, movie_duration, movie_director, tbl_customer.customer_id, country_of_residence
FROM tbl_movies, tbl_customer, tbl_download
WHERE
tbl_movies.movie_id = tbl_download.movie_id AND
tbl_customer.customer_id = tbl_download.customer_id AND
tbl_customer.country_of_residence != 'spain'

this query shows all the movies download when the country of residence isnt 'spain'

elmo_helper
12-09-2011, 11:22 AM
basically the current code show the bits i dont want.

there has been 20 downloads of 10 different movies and 4 of these downloads dont show up as these occur by people in the usa. how do i get these to show up and not the 16 that do show up.

thanks in advance

elmo_helper
12-09-2011, 04:48 PM
select distinct tbl_movies.movie_id, movie_title
FROM tbl_movies, tbl_customer, tbl_download
WHERE
tbl_customer.customer_id = tbl_download.customer_id and
tbl_movies.movie_id = tbl_download.movie_id

minus
select tbl_movies.movie_id, movie_title
from tbl_movies, tbl_customer, tbl_download
where tbl_customer.customer_id = tbl_download.customer_id and
tbl_movies.movie_id = tbl_download.movie_id
and country_of_residence='usa'

i have this and it works but it doesn't show up the movies that havnt been downloaded by anyone