Combine two integers to create a unique number

后端 未结 7 2071
北荒
北荒 2020-12-10 02:05

Good Morning,

I was looking for a way to combine two integers to create a unique number, I have two tables that I need to combine into a third table with unique numb

7条回答
  •  眼角桃花
    2020-12-10 02:19

    Use ((a + b)(a + b + 1) * 0.5) + b Reference http://en.wikipedia.org/wiki/Pairing_function

提交回复
热议问题