title: Is there a function to easily create a surrogate key in Snowflake?
body: <p>Is there an easy/efficient way to create surrogate keys in Snowflake?</p>
  <p><a href="https://i.stack.imgur.com/hsAhj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hsAhj.png" alt="enter image description here" /></a></p>
  <p>Imagine this data set is going to be selected into in a table,
  during the insertion a battery_id column is added, which is the battery_uuid column mapped to a surrogate key.
  In this case specific case that could become e.g. [1,1,2,1,1,2,3].
  Sequences in Snowflake do not have this functionality, because that becomes e.g. [1,2,3,4,5,6,7].
  It is preferable if this mapping is done during the insertion, however, it could also be done after insertion if necessary.
  As context: This column is added because joins on UUID's are not performant.</p>