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 are the things to be considered while creating secondary index?
Discuss the advantages of using partitioned primary index in a query?
Can we have an unconnected lkp to lookup a db2 record against a teradata record? Doesnt seem to work. I could be wrong
Comment whether bottleneck is an error or not.
What is the use of fallback?
How do you verify a complicated sql?
What is a node in teradata?
Explain the advantages of partitioned primary index in a query?
how can we analyze the locks ?
Describe the between keyword in teradata?
What are the various etl tools in the market?
Backup Script was blocked then you are unable to archive the data. how do you analyze it and where do you identify ?
How many sessions of MAX is PE capable of handling at a particular time?
Let us say there is a file that consists of 100 records out of which we need to skip the first and the last 20 records. What will the code snippet?
If I wanted to run a TPump job only once per day - basically working on a file that is produced once per day - how would you set up the parameters for that sort of job ?