@AlderwiereldDISTINCTwill return unique combinations of values. If you select three columns then DISTINCT will show unique combinations of the three columns (or unique "tuples" in database terminology).
If you want to use those unique values in another query then the easiest option is to put them in the FROM clause.
SELECT
products.*
FROM
-- Get all the distinct product_id's of ordered products.
-- (i.e. only show each product once, regardless of how many
-- times it has been ordered.
(SELECT DISTINCT product_id FROM orders) AS purchased_products
-- join back onto product table to show the full details of only
-- those products that have been ordered.
INNER JOIN products ON purchased_products.product_id = products.product_id
Obviously there are better ways than using DISTINCT for the query above, but it's the simplest way to demonstrate the concept.