Skip to content
Advertisement

How to make a SELECT MAX(id) inside UPDATE?

I’m starting in Mysql and I’m trying to find a way to select the maximum id inside update. This is what I tried but it doesn’t work.

Advertisement

Answer

Use ORDER BY and LIMIT.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement