Re: remove gaps in a table
From: mireero <mireero_at_free.fr>
Date: Wed, 20 Dec 2017 13:28:22 +0100
Message-ID: <5a3a5766$0$4837$426a34cc_at_news.free.fr>
>
> It seems to me that the point of an order_id is so the customer and
> your company can use it to refer to a specific order in communications
> between them. In this case, every time you change an order_id, you
> have to inform the customer. Customers won't put up with that for
> very long.
>
> If you think about it, it gets even worse with bank account numbers
> where you have transactions in transit with bank account numbers
> on them, and the consequences of having a transaction get attached
> to the wrong account are much more serious.
>
> It's not at all uncommon for a change in a database to have or need
> real-world consequences.
>
In this case, the order_id is the really unique and everlasting identifier of an order.
The order_number is only an interface with the client. I agree that it shouldn't change.
But I have gaps... Received on Wed Dec 20 2017 - 13:28:22 CET
Date: Wed, 20 Dec 2017 13:28:22 +0100
Message-ID: <5a3a5766$0$4837$426a34cc_at_news.free.fr>
On 12/20/2017 12:07 PM, Gordon Burditt wrote:
>> - order_id is unique >> - order_number is unique for a given month and start back at 1 every month. >> - there are gaps in the order_id sequence, for example, in october, we >> have 4 orders with order_number: 1, 2, 3, 5. >> In november, we have 6 orders with order_number: 1, 2, 4, 9, 10. >> >> [Quoted] >> I'm looking for a way to "reduce" the order_number, to remove gaps, that >> is to obtain:
>
> It seems to me that the point of an order_id is so the customer and
> your company can use it to refer to a specific order in communications
> between them. In this case, every time you change an order_id, you
> have to inform the customer. Customers won't put up with that for
> very long.
>
> If you think about it, it gets even worse with bank account numbers
> where you have transactions in transit with bank account numbers
> on them, and the consequences of having a transaction get attached
> to the wrong account are much more serious.
>
> It's not at all uncommon for a change in a database to have or need
> real-world consequences.
>
In this case, the order_id is the really unique and everlasting identifier of an order.
The order_number is only an interface with the client. I agree that it shouldn't change.
But I have gaps... Received on Wed Dec 20 2017 - 13:28:22 CET