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

How do you set the session mode parameters in bteq?

605


Can we have two time dimensions in a schema(either star or snow flake)? For ex if we want joining date of employee and if we want today's sales with time whether can we have two time dimensions for accommodating above tasks?

1614


During the Display time, how is the sequence generated by Teradata?

613


If RDBMS is halted what will you do ?

1705


What does sleep function does in fast load?

616






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

631


How would you load a very large file in teradata in general?

559


How many types of joins are there in teradata?

540


What are the various reporting tools in the market?

610


What are differences between teradata and ansi session modes in teradata?

619


What is teradata? What are some primary characteristics of teradata?

545


If the PMON is not working then how do you manage and monitor all processes, resources and sessions etc.

1663


Explain PDE.

602


Comment whether bottleneck is an error or not.

615


any one answer me how they can analyzing the project using data ware housing?

2025