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 normalization, first normal form, second normal form and third normal form?
How do you verify a complicated sql?
In Teradata, how do we Generate Sequence?
How many sessions of MAX is PE capable of handling at a particular time?
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?
How will you solve the problem that occurs during update?
What is the use of virtual processor connectivity in teradata?
What are the joins in teradata?
Explain the term 'database' related to relational database management system?
Define views in teradata with general syntax.
Can any one explain me the difference between BTEQ and MLOAD,TUMP. All canbe used for same purpose but still differnt methods. why ?
What are the steps to create a data model?
What are different table types used in teradata?
Which is more efficient group by or distinct to find duplicates?