Mysql update where id max id




















Here, we're assuming that it will be set to NULL. Again, write a SELECT statement first, which returns the new 'hival' value to be assigned, and verify that is working.

An entirely different question one that wasn't asked is evaluating whether the hival column is actually needed. That question is not addressed here. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 4 years, 8 months ago. Active 4 years, 8 months ago. Viewed 1k times. Add a comment.

Active Oldest Votes. Yes, you should generally never store data that you can easily access or generate from existing data using SQL queries. This query is part of a much larger and more complicated query which works perfectly -- IF the hival column is marked with a 1. I really didn't think this would be so hard, but You asked a question. I have answered that. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.

The Overflow Blog. Stack Gives Back Safety in numbers: crowdsourcing data on nefarious IP addresses. Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Linked Related 6. Hot Network Questions.

Active 6 years, 4 months ago. Viewed 1k times. Add a comment. Active Oldest Votes. Harshit Harshit 5, 7 7 gold badges 38 38 silver badges 89 89 bronze badges.

Why would you link a deprecated function? If anyone, for any reason use old libs, old methods, version or whatever, he also have the right to information. Here is some extract from this link: click me It is not exactly what you need, but it has an approach to deal with such problems.

In this case, there are two good ways to implement reading and incrementing the counter: First update the counter by incrementing it by 1, and then read it. SergeyAn SergeyAn 6 6 silver badges 9 9 bronze badges. In General No Problem. Community Bot 1 1 1 silver badge. Mohammed Elhag Mohammed Elhag 4, 1 1 gold badge 8 8 silver badges 18 18 bronze badges.

Sign up or log in Sign up using Google. Sign up using Facebook.



0コメント

  • 1000 / 1000