SQL Server's isNumeric() equivalent in amazon redshift

后端 未结 8 1969
庸人自扰
庸人自扰 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:45

    where regexp_instr(field1,'^[0-9]{4}') = 0
    

    will remove rows starting with 4 digits (the above regexp_instr will return 1 for the rows with field1 starting with 4 digits)

提交回复
热议问题