Re: remove gaps in a table

From: (wrong string) ürgen Exner <jurgenex_at_hotmail.com>
Date: Wed, 20 Dec 2017 11:27:27 -0800
Message-ID: <ogcl3d576umc58ssrknl1rpb6cma1iv9gb_at_4ax.com>


[Quoted] [Quoted] On Wed, 20 Dec 2017 19:20:09 +0100, "J.O. Aho" <user_at_example.net> wrote in comp.databases.mysql:
>For you if you want completely gapless order numbers, don't delete, when

[Quoted] [Quoted] ACK. Mark the order as "deleted" but never remove it from the DB. That is the correct way to go.

>an order is "deleted", you generate a new order which is the complete
>opposite of the original order, so if the original order is for 3 nails
>of a value of 3 dollars, then the new one is for -3 nails for the value
>of -3 dollars. This way you have gapless order numbers for the
>accounting department and the numbers would be correct from an
>accounting point of view.

[Quoted] [Quoted] That is nuts. How would e.g. shipping package and send -3 nails?

[Quoted] [Quoted] That reminds me of a hack in some really large company where there was [Quoted] some very special item (a very special screw or washer or something like that). It was so leight-weight, that the ordering system refused to accept the weight. On the other hand it was needed only in very small quantities, so making the smallest shipping unit a box of 100 or 1000 was out of the question, too.
The hack was to enter the actual weight multiplied by 10000 into the DB to make the DB happy. No problem, everyone involved knew about the deception, it was working fine for some time. That is until someone did order a larger quantity. The shipping system detected the heavy weight, ordered a semi truck specifically for this shipment, and the truck driver had a good laugh when the whole cargo in his 18-wheeler was a single 3.5kg box instead of the expected 35 tons.

jue
. Received on Wed Dec 20 2017 - 20:27:27 CET

Original text of this message