Re: remove gaps in a table
Date: Fri, 22 Dec 2017 09:36:18 +0000
Message-ID: <p1ijmi$i7p$2_at_dont-email.me>
On 20/12/17 19:27, J�rgen Exner wrote:
> 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
>
> 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.
>
> That is nuts. How would e.g. shipping package and send -3 nails?
>
Easily. Thats how a customer returning three nails is represented in the database. In this case you SEND a credit note and RECIEVE the nails as against sending the nails and invoice and receiving payment,
> That reminds me of a hack in some really large company where there was
> 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
> .
>
-- Ideas are more powerful than guns. We would not let our enemies have guns, why should we let them have ideas? Josef StalinReceived on Fri Dec 22 2017 - 10:36:18 CET