I've got a "fact" transaction table in which a ticket has several transactions, each transaction is really a registry. To recognize a ticket I must group the table with 5 fields, (4 amounts along with a date) that produces a 22 digit number, but to have the ability to utilize it effectively, it must be 19 digit max.
The entire quantity of tickets the table could store is really a 10 digit number max.
How do i get yourself a <= 19 unique number, from the 22 unique number composed by 5 amounts (including date changed)?
It may sound just like a hash in my experience, however i have no idea much about the subject, and want so that it is unique and number.
I think you will struggle to locate a hash function that can arbitrary (unknown) input data and guarantee a unique output.
The easiest solution would certainly be to include an autoincrement area for your table.