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 the term 'tables' related to relational database management system?
What is the basic syntax for teradata select statement?
How do you do backup and recovery in teradata?
What is spool space? Why do you get spool space errors? How do trouble-shoot them?
What is the primary index in teradata?
Did you write stored procedures in teradata?
Backup Script was blocked then you are unable to archive the data. how do you analyze it and where do you identify ?
Which is more efficient group by or distinct to find duplicates?
Explain fastload in teradata?
What is teradata?
How to view every column and the columns contained in indexes in teradata?
How to load specific no.of records using bteq, or fastload,or multiload
Which is faster fastload or multiload?
What are the various indexes in teradata?
what are the day to day activities of teradata DBA ?