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
Answers were Sorted based on User's Feedback
Answer / chelvam
select C1,
CASE WHEN ( C1( UPPERCASE) = C1(CS) ) THEN
'NUMERIC'
ELSE
'ALPHANUMERIC'
END as C11
from TableName;
Is This Answer Correct ? | 3 Yes | 2 No |
Answer / 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 |
Answer / parthi
SELECT * FROM C1
WHERE TD_SYSFNLIB.TO_NUMBER(C1) IS NOT NULL;
Is This Answer Correct ? | 0 Yes | 0 No |
Why Fload doesn’t support multiset table?
how do you manage the production space. what are the proactive methods you can take ?
Explain the new features of teradata?
how teradata fetches a row from primary index table?
Explain the types of join supports by teradata?
What are the components used in smp and massively parallel processing (mpp) machines?
what is the difference between primary index and secondary index?.
can I use “drop” statement in the utility “fload”?
2 Answers Accenture, CTS, NTT Data,
List out teradata data types?
i learn teradata,it is so intersting,now i want teradata certifications ,so any 1 help me to get teradata certifications TD 12 ? email:kdcrazyy@gmail.com
What is a three-tier data warehouse?
How to cast date "2015-03-03-012204-000000" to timestamp