Finding only numneric values or only alphabetic values inside a alphanumeric column in Teradata.

Teradata: Numeric or Alphabetic data in Alphanumeric Column

There are many cases where alphanumeric data is stored in columns of Teradata tables. Sometime it is required to get only numeric data from alphanumeric column of a table. Sometime it is required to find only alphabetical data from alphanumeric column of a table. In this tutorial, we will see multiple approaches to achieve the required output. Illustration will be done by creating table with sample data.

Creating Sample Table

CREATE MULTISET TABLE alphanumeric_test(
   id INTEGER,
   user_id VARCHAR(50),
   Name VARCHAR(100)

Insert Alphanumeric data in Table

INS alphanumeric_test(1,'alpha','Teradata');
INS alphanumeric_test(2,'beta','Oracle');
INS alphanumeric_test(3,'gamma','Vertica');
INS alphanumeric_test(4,'12345','Mysql');
INS alphanumeric_test(5,'123gamma','DB2');
INS alphanumeric_test(6,'54321','Python');
INS alphanumeric_test(7,'433alpha','Scala');
INS alphanumeric_test(8,'alpha4532','R');
INS alphanumeric_test(9,'24343','Hive');
INS alphanumeric_test(10,'PETA','Pig');
INS alphanumeric_test(11,'beta2322','Hbase');
INS alphanumeric_test(12,'324BETA','Hbase');
INS alphanumeric_test(12,'324GAMMA6545','Hbase');
Note: It is assumed that data contains only numbers & characters

Finding Numeric Data in Alphanumeric Column

Finding Alphabetic Data in Alphanumeric Column

Finding only Alphanumeric data