help for code to search tables for something not download in a certain country?
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: help for code to search tables for something not download in a certain country?

  1. #1
    Join Date
    Dec 2011
    Posts
    8

    help for code to search tables for something not download in a certain country?

    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'

  2. #2
    Join Date
    Dec 2011
    Posts
    8
    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

  3. #3
    Join Date
    Dec 2011
    Posts
    8
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width