How can I structure a mySQL query to delete a row based on the max value.
I tried
WHERE jobPositonId = max(jobPostionId)
but got
This works:
SELECT @lastid := max(jobPositonId ) from t1; DELETE from t1 WHERE jobPositonId = @lastid ;
Other than going to the database twice, is there anything wrong with this technique?