MySQL Forums
Forum List  »  Newbie

Re: Bigint unsigned value out of range
Posted by: András Keszthelyi
Date: January 24, 2024 10:41AM

Yes, you are right. In this case the auto_increment option won't play, only it was easier to write 'serial' instead of 'bigint unsigned'. Anyway, some ID values are given and they need not be consecutive. Better to say, they are NOT consecutive, as you can see the insert values.

I want to find the "gaps" by calculating the difference between ID and the next existing ID-value. Where this difference is bigger than one, there is a gap there. As NextID is calculated as the minimal one from all of those values that are bigger than the ID value of the actual row it MUST be at least one greater than the actual ID value. Or, at least, I thought it. So I cannot imagine how on earth the difference could be negative, and only when it is in a subquery. Also I have no idea why the same problem won't occur if 'where' is replaced by 'having'.

And yes, I can do the list in another, well working, way but my problem is not the "how" but the "why".


Options: ReplyQuote

Written By
Re: Bigint unsigned value out of range
January 24, 2024 10:41AM

Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.