Query to filter out the duplicate and pick the latest I'm trying to filter out duplicates and just get the latest of the form name based on the the higher number, no dates on the table:

Form Name
abc
abc-01
abc-01
abc-02
abc-02
abc-03
def-01
def-02
xyz

And I would like to get this result: 

Form Name
abc-03
def-02
xyz          

What is the query to filter that out? Any suggestions? Thank you!
The query below will probably work; the subquery extracts the highest number after the - ('Version') and the outer query concatenates them back into the original format.

SELECT CASE Version IS NULL
           WHEN 1 THEN ID
           ELSE CONCAT(ID, '-', Version)
           END
  FROM
(SELECT
  CASE LOCATE('-', name)
           WHEN 0 THEN name
           ELSE SUBSTRING(name, 1, LOCATE('-', name) - 1)
           END AS 'ID',
  MAX(CASE LOCATE('-', name)
           WHEN 0 THEN NULL
           ELSE SUBSTRING(name, LOCATE('-', name) + 1)
           END) AS 'Version'
  FROM forms
    GROUP BY CASE LOCATE('-', name)
           WHEN 0 THEN name
           ELSE SUBSTRING(name, 1, LOCATE('-', name) - 1)
           END) AS subquery


Here is an online demo.