Hi Frnds this que is recently asked at IBM
there are two rows like aa6588fhfhf,gru282vbvv.
Question is howcan we retrive the first number from two
rows.
Can any one help
thanks in advance
Answer Posted / tdguy
I hope substr function can be used but somewhat lengthy.
But UDF would make task easy.
SEL SIX
FROM
(
SEL
CASE
WHEN SUBSTR(COLUMN,1,1) IN
('1','2','3','4','5','6','7','8','9','0')
THEN '1' ELSE '' END AS ONE,
CASE
WHEN SUBSTR(COLUMN,2,1) IN
('1','2','3','4','5','6','7','8','9','0')
THEN '2' ELSE '' END AS TWO,
CASE
WHEN SUBSTR(COLUMN,3,1) IN
('1','2','3','4','5','6','7','8','9','0')
THEN '3' ELSE '' END AS THREE,
CASE
WHEN SUBSTR(COLUMN,4,1) IN
('1','2','3','4','5','6','7','8','9','0')
THEN '4' ELSE '' END AS FOUR,
SUBSTR(TRIM(ONE||TWO||THREE||FOUR),1,1) AS FIVE,
SUBSTR(COLUMN,FIVE,1) AS SIX
FROM TABLE
) A
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What is the purpose of joins in teradata?
tomorrow i have interview in infosys.can someone pour any suggestions or any interview questions. thank you
What do you mean by teradata intellicloud?
What are the 5 phases in a multiload utility?
What is the maximum number of dml can be coded in a multiload script?
What do you mean by ttu in teradata?
Explain the term 'row' related to relational database management system?
What is the function of parser component in teradata?
What is meant by Teradata Gateway?
Explain the teradata primary index mechanics in detail with a diagram.
Explain and compare pros and cons of snow flake schemas?
If Fast Load Script fails and only the error tables are made available to you, then how will you restart?
Explain BYNET.
What is teradata?
What does sleep function does in fast load?