SQL Server's isNumeric() equivalent in amazon redshift

后端 未结 8 1945
庸人自扰
庸人自扰 2021-01-04 02:17
  • I\'m using amazon redshift as my data warehouse
  • I have a field (field1)of type string. Some of the strings start with four numbers and others with letters:
8条回答
  •  失恋的感觉
    2021-01-04 03:07

    We have tried the following and worked for most of our scenarios:

    columnn ~ '^[-]{0,1}[0-9]{1,}[.]{0,1}[0-9]{0,}$'

    This will positive, negative, integer and float numbers.

提交回复
热议问题