MySql使用Like来查找字符串的最高值

I don't think this should be all that complicated, but I'm having an issue building a query to pull the higher lower value from a table, where the identifier is higher.

So basically, I have a table that contains this (among other things):

8A     6253.85
8B     6184.64

I want to find the 8B and get the value of 6184.64.

I have used the following query:

SELECT * FROM payments WHERE contract = '".$contract."' AND payment LIKE '".$x."%' LIMIT 1

where $x is 8, but of course, get the 6253.85, because it comes first.

I tried:

SELECT * FROM payments WHERE contract = '".$contract."' AND payment LIKE '".$x."%' DESC LIMIT 1

which is essentially what I want to do, but this doesn't work (sql error).

If anyone can give me a quick suggestion on how to make sure I alway pull the "last" row that matches, I would appreciate it.

Thanks in advance.

Just add an ORDER BY payment DESC (before the LIMIT clause).

 FROM ...
WHERE ...
  AND ...
ORDER BY payment DESC
LIMIT 1

(A LIKE predicate returns TRUE or FALSE (or NULL) for each row, and can't be used to sort higher and lower values, unless you have a special case of "known" values.)