'Filtering for only integer/numeric values in a varchar field

I have a table with a member id column (non-PK) that should all be integers. But many are NULL or non-integer values with a mixture of letters, numbers, and other random characters (the field is of type varchar). I want to select only rows containing valid member id's (i.e. integers or only numeric values). I'm working in SQL Workbench. Thanks in advance!



Solution 1:[1]

Because I'm connecting to redshift, the syntax is

where column ~ '[0-9].+'

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Vzzarr