Hi frnds...can any one help me regarding this que..
We have column in a table name it as C1 WHICH CONTAIN
ALPHANUMERIC AND NUMERIC VALUES.
C1
2A
2B
2V
2H
1
2
3
4
5
i want to retrive numeric values like 1,2,3,4,5
How we can get
Plz let me know.Thanks in advance
Answer Posted / tdguy
Assuming the column to be char(2), we can use the following
sql to retrieve the numeric values.
SEL C1 FROM
(SEL C1,
CASE
WHEN SUBSTR(C1,1,1) IN
('1','2','3','4','5','6','7','8','9','0')
THEN 'N'
WHEN SUBSTR(C1,1,1) IN (' ')
THEN 'S'
END AS ONE,
CASE
WHEN SUBSTR(C1,2,1) IN
('1','2','3','4','5','6','7','8','9','0')
THEN 'N'
WHEN SUBSTR(C1,2,1) IN (' ')
THEN 'S'
END AS TWO FROM STUD2
) A
WHERE ((A.ONE='N' AND A.TWO='N')
OR
(A.ONE='N' AND A.TWO='S')
OR
(A.ONE='S' AND A.TWO='N'))
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What are the components provided on node?
Explain teradata architecture in detail with a diagram.
any one answer me how they can analyzing the project using data ware housing?
How teradata makes sure that there are no duplicate rows being inserted when its a set table?
Briefly explain each of the following terms related to relational database management system (rdbms) – database, tables, columns, row, primary key and foreign key.
Explain the advantages of partitioned primary index in a query?
What is oltp?
What is meant by a Channel Driver?
What's the difference between timestamp (0) and timestamp (6)?
Explain vproc in teradata?
What is the difference between teradata and basic rdbms?
how do we write scripts in unix how to execute scripts in real time anybody please needfull or give me number i will cal u
What is the purpose of upsert command?
Explain the most common data types used in teradata?
Why is the case expression used in teradata?