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
What is the purpose of joins in teradata?
Mention the procedure via which, we can run Teradata jobs in a UNIX environment.
What are the frequently used data types in teradata?
What are the different design perspectives used in teradata?
What are the different table types that are supported by teradata?
What is multi insert?
What is the particular designated level at which a LOCK is liable to be applied in Teradata?
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?
What is teradata?
Define views in teradata with general syntax.
When tpump is used instead of multiload?
Explain teradata architecture?
Hi send me the Teradata dumps to my id rajeshanantha@yahoo.co.in Thanks Rajesh. A
Why are oltp database designs not generally a good idea for a data warehouse?
Explain teradata utilities. What is multiload, fast load, tpump?