I have a table that might have one or more rows with the same value for the key_property column.
I want to build a query in MySql that returns a set where every value of key_property is represented for only one of its corresponding rows and that it also receives a key_property filter for a like sentence, chosen by the max value of another column (say, event_id).
How can I achieve that?
UPDATE:
Here's a sample of the non-filtered table:
+--------------+--------+----------+
| key_property | others | event_id |
+--------------+--------+----------+
| abcd | B | 1 |
| abcd | A | 2 |
| defg | C | 3 |
| abcd | D | 4 |
| hijk | f | 4 |
+--------------+--------+----------+
When executing the query with the filter setted as 'd', the result data should look like this:
+--------------+--------+----------+
| key_property | others | event_id |
+--------------+--------+----------+
| abcd | D | 4 |
| defg | C | 3 |
+--------------+--------+----------+