Ok,
I want to select a record from a mysql database table, and to determine the record, I want to look in the field for each record and find which has the highest value.
Hope this isn't too confusing, thanks.
selecting record which has a field with highest value
Moderator: General Moderators
If I understood it right, you should manage this by using something like:
'max(id)' would give you the highest number of id (usually an auto_incr. number, change to fit your needs), combined with 'limit 1' that narrows down the hits to one row of results.
Hope that helped some.
Code: Select all
select * from table where id = max(id) limit 1Hope that helped some.