Напомните, какую часть проблемы не может решить следующая проблема ...
DROP TABLE IF EXISTS product;
CREATE TABLE product
(id SERIAL PRIMARY KEY
,title VARCHAR(30) NOT NULL
,pages INT NOT NULL
);
INSERT INTO product VALUES
(1,'Harry Potter',230),
(2,'Lord of the Rings',950),
(3,'Game of Thrones',980);
DROP TABLE IF EXISTS prices;
CREATE TABLE prices
(product_id INT NOT NULL
,book_type INT NOT NULL
,price DECIMAL(5,2) NOT NULL
,PRIMARY KEY(product_id,book_type)
);
INSERT INTO prices VALUES
(1,0,20.40),
(1,1,28.00),
(1,2,40.00),
(2,0,15.00),
(2,1,25.50),
(2,2,42.00),
(3,0,21.00),
(3,1,30.50),
(3,2,47.00);
SELECT c.*
, a.*
FROM prices a
JOIN prices b
ON b.product_id = a.product_id
JOIN product c
ON c.id = b.product_id
WHERE b.price LIKE '%1%';
+----+-------------------+-------+------------+-----------+-------+
| id | title | pages | product_id | book_type | price |
+----+-------------------+-------+------------+-----------+-------+
| 2 | Lord of the Rings | 950 | 2 | 0 | 15.00 |
| 2 | Lord of the Rings | 950 | 2 | 1 | 25.50 |
| 2 | Lord of the Rings | 950 | 2 | 2 | 42.00 |
| 3 | Game of Thrones | 980 | 3 | 0 | 21.00 |
| 3 | Game of Thrones | 980 | 3 | 1 | 30.50 |
| 3 | Game of Thrones | 980 | 3 | 2 | 47.00 |
+----+-------------------+-------+------------+-----------+-------+