SQL - safely downcast BIGINT to INT

前端 未结 4 960
栀梦
栀梦 2020-12-11 03:13

I have a CSV I\'m importing into our database. One of the \"columns\" contains data that should be an INT but some rows have numbers that only fall in the BIGINT ra

4条回答
  •  执笔经年
    2020-12-11 03:48

    You could also convert the value to a string, trim it to length and convert to int. not the best way, but a safe easy way for sure

提交回复
热议问题