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

Answer Posted / tdguy

Above answer is correct. Update statement would be the best
option (with case).

Update tablename
set mark3 = case when mark1>mark2
then mark1 else mark2 end;

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain Teradata performance tuning and optimization?

1165


Describe primary index in teradata. And what are the available primary index types?

1004


What is multi insert?

1053


What is node? How many nodes and amps used in your previous project?

1110


What is a node in teradata? Explain

1010


How to load specific no.of records using bteq, or fastload,or multiload

1747


What is the command in bteq to check for session settings ?

1180


Explain some differences between mpp and smp?

1105


Explain teradata utilities. What is multiload, fast load, tpump?

1008


What is the purpose of using case expression in teradata?

1017


Explain the term 'foreign key' related to relational database management system?

1043


What are the different functions performed in development phase?

1080


Define views in teradata with general syntax.

1035


How does hashing happens in teradata?

1091


What is called partitioned primary index (ppi)?

1013