1

I need to check if the input is integer. using postgres on amazon redshift.

The following I tried

select 1,
case when ISNUMERIC(11) -- like  '[0-9][0-9]'
then 'is_num'
else
'non_num'
end as xxx
Chio
  • 63
  • 1
  • 3
  • 7
  • what is output you getting ? – Ameya Deshpande Jun 18 '15 at 13:31
  • ERROR: function isnumeric(integer) does not exist Hint: No function matches the given name and argument types. You may need to add explicit type casts. – Chio Jun 18 '15 at 13:31
  • http://stackoverflow.com/questions/16195986/isnumeric-with-postgresql this will help you – Ameya Deshpande Jun 18 '15 at 13:32
  • `select 1, case when cast('11' as int) -- like '[0-9][0-9]' then 'is number' else 'non_numeric' end as data_type ` this works ..but on giving `11AX` fails :( – Chio Jun 18 '15 at 13:33

0 Answers0