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

Describe the between keyword in teradata?

616


What do you mean by teradata sql assistant?

596


What are the steps involved after the disk manager passes the request?

582


What are the components provided on node?

581


Explain the advantages of partitioned primary index in a query?

567






Syntax for case when statement?

616


Mention a few of the ETL tools that come under Teradata.

624


If Fast Load Script fails and only the error tables are made available to you, then how will you restart?

637


What do you mean by tpt in teradata?

593


What are the functions performed by bynet?

615


Explain the parallel data extension in teradata?

662


There is a column with date in it. If I want to get just month how it can be done? Can I use sub string?

647


What is the particular designated level at which a LOCK is liable to be applied in Teradata?

604


What can be achieved by using the teradata rdbms?

630


Why is the case expression used in teradata?

595