these inner/outer/left joins are causing me many problems
i am trying to creat a query which will:
1/ pull out ll the rows from a table (has 40000+ rows)
2/ then join the price table BUT only return 1 row from the prices table where the price is the cheapest
so this query
returns 100,000+ rows because it returns a new row for each price found for every product
so at the moment say the above query is returning:
prod1 -> ... -> 3.99
prod1 -> ... -> 5.99
prod1 -> ... -> 1.99
prod2 -> ... -> 6.99
prod3 -> ... -> 16.99
prod3 -> ... -> 16.99
... show more fields
i want it to return this
prod1 -> ... -> 1.99
prod2 -> ... -> 6.99
prod3 -> ... -> 16.99
is this possible?
many thanks

i am trying to creat a query which will:
1/ pull out ll the rows from a table (has 40000+ rows)
2/ then join the price table BUT only return 1 row from the prices table where the price is the cheapest
so this query
Code:
SELECT * FROM `tbl_dvds` AS dvd INNER JOIN ( tbl_prices AS price ) ON price.prodID = dvd.filmID
so at the moment say the above query is returning:
prod1 -> ... -> 3.99
prod1 -> ... -> 5.99
prod1 -> ... -> 1.99
prod2 -> ... -> 6.99
prod3 -> ... -> 16.99
prod3 -> ... -> 16.99
... show more fields

i want it to return this
prod1 -> ... -> 1.99
prod2 -> ... -> 6.99
prod3 -> ... -> 16.99
is this possible?
many thanks
Comment