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
Explain Teradata performance tuning and optimization?
Describe primary index in teradata. And what are the available primary index types?
What is multi insert?
What is node? How many nodes and amps used in your previous project?
What is a node in teradata? Explain
How to load specific no.of records using bteq, or fastload,or multiload
What is the command in bteq to check for session settings ?
Explain some differences between mpp and smp?
Explain teradata utilities. What is multiload, fast load, tpump?
What is the purpose of using case expression in teradata?
Explain the term 'foreign key' related to relational database management system?
What are the different functions performed in development phase?
Define views in teradata with general syntax.
How does hashing happens in teradata?
What is called partitioned primary index (ppi)?