Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Finding missing sequence records in DB tableby gmax (Abbot) |
on Aug 05, 2003 at 11:41 UTC ( [id://280946]=note: print w/replies, xml ) | Need Help?? |
If I understand correctly, the gist of what you are asking is "how can I find which records are missing from a given sequence?" If this is true, one method to find out is to use an auxiliary table containing all the sequence numbers, and perform a LEFT JOIN to your table. First, create such table and fill it with the values from 1 to the maximum record number you want to consider. What Corion said about maximum record number and unique numbers in Transaction are still valid and you should check them. However, assuming that TransactionID is unique, this method will find the missing rows very fast.
HTH _ _ _ _ (_|| | |(_|>< _|
In Section
Seekers of Perl Wisdom
|
|