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
Is it necessary to add? Quit statement after a bteq query when I am calling it in a unix environment?
Hi, If anyone has TD 14 Basics dumps or study materials, please share. nirmaaal1991@gmail.com
What is node? How many nodes and amps used in your previous project?
What is the difference between union and union all in teradata?
My table got locked during mload due to a failed job. What do I do to perform other operations on it?
how many modules are there in telecome domain?how to explain the architecture?
What's the difference between timestamp (0) and timestamp (6)?
What is bteq utility in teradata?
List the logical and conditional operators that are used with teradata along with their meanings?
What is the command in bteq to check for session settings ?
How many types of joins are there in teradata?
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 ?
Different phases of multiload?
Explain teradata utilities. What is multiload, fast load, tpump?
Can we have two time dimensions in a schema(either star or snow flake)? For ex if we want joining date of employee and if we want today's sales with time whether can we have two time dimensions for accommodating above tasks?