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
Which is more efficient group by or distinct to find duplicates?
How to load specific no.of records using bteq, or fastload,or multiload
What is the basic syntax for teradata select statement?
How would you load a very large file in teradata in general?
What are different table types used in teradata?
Why are oltp database designs not generally a good idea for a data warehouse?
How is MLOAD Teradata Server restarted after execution?
Highlight a few of the advantages that ETL tools have over Teradata.
What are the different methods ot loading a dimension table? A fact table etc?
Explain the term 'columns' related to relational database management system?
Explain the term 'primary key' related to relational database management system?
What is node? How many nodes and amps used in your previous project?
Hi, If anyone has TD 14 Basics dumps or study materials, please share. nirmaaal1991@gmail.com
What are the different table types that are supported by teradata?
What are the multiload utility limitations?