I am trying to select the highest pair from a table that has been created by joining (combining) two tables. I guess I should use a nested query but I'm not sure how.
I also came around a similar question that seems a bit less complex, but I am struggling to implement it into my problem.

Similar question: [How to select max timestamp from each currency pair SQL?](https://stackoverflow.com/questions/50728389/how-to-select-max-timestamp-from-each-currency-pair-sql)

My tables:

Book:

| title | publisher | price | sold |
| --- | --- | --- | --- |
| book1 | A | 5 | 300 |
| book2 | B | 15 | 150 |
| book3 | A | 8 | 350 |

Publisher:

| code | name |
| --- | --- |
| A | ABook |
| B | BBook |
| C | CBook |

My query:

```
SELECT b.titel, p.name, max(b.price*b.sold) as 'Revenue"
FROM publisher p, book b
WHERE p.code = b.publisher

```

Gives:

| title | publisher | Revenue |
| --- | --- | --- |
| book1 | ABook | 1500 |
| book2 | BBook | 2250 |
| book3 | ABook | 2800 |

Desired output:

| title | publisher |
| --- | --- |
| book2 | BBook |
| book3 | ABook |

How to alter my query to get the highest revenue per book title and the corresponding publisher?