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 / subbu
Hi NBK,
You can use the below UPD query to update the mark3 field
with maximum marks of Mark1 or Mark2 fields.
Update db_name.Tab_name
set mark3 = case
when mark1>mark2
then mark1
else mark2
end
| Is This Answer Correct ? | 13 Yes | 0 No |
Post New Answer View All Answers
In Teradata, how do we Generate Sequence?
What are the uses of bynets in multi-node systems?
What are the different softwares used with their functions in teradata?
What do you mean by tpt in teradata?
how do we write scripts in unix how to execute scripts in real time anybody please needfull or give me number i will cal u
What are differences between teradata and ansi session modes in teradata?
Explain teradata architecture in detail with a diagram.
If the PMON is not working then how do you identify and monitor all the processes, resources and sessions ?
In the Primary Index, what is the score of AMPs that are actively involved?
Give a justifiable reason why Multi-load supports NUSI instead of USI.
What exactly do you know about catching in teradata?
What are the joins in teradata and how many types of joins are there in teradata?
What are the available join types in teradata?
What is the use of stored procedures in teradata?
Highlight all the modes that are present under Confidence Level.