SQL Server's isNumeric() equivalent in amazon redshift

后端 未结 8 1896
庸人自扰
庸人自扰 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 02:52

    redshift should support similar to.

    WHERE field1 SIMILAR TO '[0-9]{4}%'
    

    This reads as where field1 starts with 4 characters in the range of 0-9, then anything else.

提交回复
热议问题