Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



Hi Frnds this que is recently asked at IBM there are two rows like aa6588fhfhf,gru282vbvv. Questi..

Answer / 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

Hi Frnds this que is recently asked at IBM there are two rows like aa6588fhfhf,gru282vbvv. Questi..

Answer / rkraju

Hi,gautam nice 2 see ur answer can u show me that output in
one sql.,
thanks in advance

Is This Answer Correct ?    1 Yes 0 No

Hi Frnds this que is recently asked at IBM there are two rows like aa6588fhfhf,gru282vbvv. Questi..

Answer / pavan

sel (case
when position('1' in name)>0 then substring(name from position('1' in name) for 1)
when position('2' in name)>0 then substring(name from position('2' in name) for 1)
when position('3' in name)>0 then substring(name from position('3' in name) for 1)
when position('4' in name)>0 then substring(name from position('4' in name) for 1)
when position('5' in name)>0 then substring(name from position('5' in name) for 1)
when position('6' in name)>0 then substring(name from position('6' in name) for 1)
when position('7' in name)>0 then substring(name from position('7' in name) for 1)
when position('8' in name)>0 then substring(name from position('8' in name) for 1)
when position('9' in name)>0 then substring(name from position('9' in name) for 1)
when position('0' in name)>0 then substring(name from position('0' in name) for 1)
else substring(name from 0 for 1)
end),name from ttemp.t2sel (case
when position('1' in name)>0 then substring(name from position('1' in name) for 1)
when position('2' in name)>0 then substring(name from position('2' in name) for 1)
when position('3' in name)>0 then substring(name from position('3' in name) for 1)
when position('4' in name)>0 then substring(name from position('4' in name) for 1)
when position('5' in name)>0 then substring(name from position('5' in name) for 1)
when position('6' in name)>0 then substring(name from position('6' in name) for 1)
when position('7' in name)>0 then substring(name from position('7' in name) for 1)
when position('8' in name)>0 then substring(name from position('8' in name) for 1)
when position('9' in name)>0 then substring(name from position('9' in name) for 1)
when position('0' in name)>0 then substring(name from position('0' in name) for 1)
else substring(name from 0 for 1)
end),name from ttemp.t2;

Is This Answer Correct ?    1 Yes 0 No

Hi Frnds this que is recently asked at IBM there are two rows like aa6588fhfhf,gru282vbvv. Questi..

Answer / santosh

sel regexp_substr('aa6588fhfhf','[[:digit:]]+')
Ans:6588

Is This Answer Correct ?    0 Yes 0 No

Hi Frnds this que is recently asked at IBM there are two rows like aa6588fhfhf,gru282vbvv. Questi..

Answer / ashutosh gautam

Use DIGITS("aa6588fhfhf") in transform it will return only
digit as 6588.

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More Teradata Interview Questions

How can we load single row of data into teradata database. please give me the process.

3 Answers  


What are the functions involved in shared information architecture?

0 Answers  


I have all the TERADATA Certification Dumps for the below: NR0-011, NR0-012, NR0-013, NR0-014 NR0-015 NR0-016, NR0-017 If anyone need it, pls drop me a mail with Code in the mail to: terashish@gmail.com

201 Answers   Cognizant, Deloitte, IBM, Prometric, Syntel,


List out all forms of LOCKS that are available in Teradata.

0 Answers  


What is bteq script in teradata?

0 Answers  


Hi All, I have a table with 3 fields like id,mark1,mark2 and I would like to update a mark3 field that would calculate the max for each record (so the max value of the 2 fields) in Teradata ID Mark1 Mark2 Mark3 1 10 20 2 20 30 3 40 10 4 50 50 I Have to write a update statement Mark3 with max value of mark1,mark2 fields…like bellow ID Mark1 Mark2 Mark3 1 10 20 20 2 20 30 30 3 40 10 40 4 50 50 50 Please any one help me ....Thq

3 Answers   Wipro,


Aborted in Phase 2 data acquistion completed in fastload?

2 Answers  


What is called partitioned primary index (ppi) and discuss the advantages of using it in a query?

0 Answers  


What are the enhanced features in teradata v2r5 and v2r6?

0 Answers  


Name the five phases that come under MultiLoad Utility.

0 Answers  


Why Fload doesn’t support multiset table?

9 Answers  


What is the purpose of joins in teradata and what are the available join types?

0 Answers  


Categories