Combine two integers to create a unique number

后端 未结 7 2081
北荒
北荒 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:31

    If SchoolID is always a 3 digit number multiply ClassId by 1000 then add SchoolID.

    Your number might "overflow" though., and given the ones you have if they are 32-bit they will.

提交回复
热议问题