|
[
Permlink
| « Hide
]
Satheesh Bandaram added a comment - 05/May/05 07:38 AM
While it may be desirable not to have gaps in identity values, the current implementation does match required uniqueness.
Per Satheesh's comment in May this does not appear to be a bug
While I agree it's not a bug, I could see this as an improvement. It would be more natural to have consective values in this case.
I used this technique within an SQL script to create consecutive numbers for some tables. I had to use temporary intermediate tables to circumvent this effect.
I agree that it's not a real "bug", but it's an undesirable effect. Kathey, could you please change the issue type from "bug" to "improvement" and the status back to "open"? Ran test script on Derby 10.2beta. The behavior is still the same, you do not get consequtive ids for the given query (with "insert ... select distinct").
Recategorized issue, as the current behavior is not a bug. Just to add another data point, the identity values are consecutive if you put another query around the select distinct:
ij> insert into temp2 (s) select * from (select distinct s from temp1) t; 4 rows inserted/updated/deleted ij> select * from temp2; I |S ---------------------- 1 |d 2 |b 3 |c 4 |a 4 rows selected For some reason, the ordering is different too. I agree with that analysis, Knut.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||