I'm quite new to SQL, so it might be a noob question:
Let's say my query is:
select [Item], [Answers] from table1
And it retrieves the following table:
Item Answers
------------------
Car Expensive
Car Cheap
Car Medium
Boat Expensive
Boat Very Expensive
Boat Ultra Expensive
Given a certain second table (or dictionary, I don't really know how to do it) {Cheap: 1, Medium: 2, Expensive: 3, Very Expensive:4, Ultra Expensive: 5} - meaning that "Ultra Expensive" is the highest rank and "Cheap" is the lowest rank.
In SQL, on this kind of table with many duplicates in Column A (Item) how do I retrieve the highest ranked value in Column B (Answers) for each unique value in Column A?
In this example, I would like to get:
Item Answers
------------------
Car Expensive
Boat Ultra Expensive
Just one of each duplicated value in column 'Item' and its highest ranked possible value in 'Answers'?