Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



Hi All, I have a table with 3 fields like id,mark1,mark2 and I would like to update a mark3 field..

Answer / 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

Hi All, I have a table with 3 fields like id,mark1,mark2 and I would like to update a mark3 field..

Answer / 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

Hi All, I have a table with 3 fields like id,mark1,mark2 and I would like to update a mark3 field..

Answer / rajesh

I didnt understand ur question,give me correct question and
excat o/p u wanted ,send example o/p what u wanted

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Teradata Interview Questions

What is the process to restart the multiload if it fails?

7 Answers  


What are types of partition primary index (ppi) in teradata?

0 Answers  


While creating table my dba has fallback or no fallback in his ddl. What is that?

0 Answers  


Highlight the limitations of TPUMP Utility.

0 Answers  


What is spool space?

0 Answers  


Explain about Skew Factor?

6 Answers   TCS,


What are the components used in smp and massively parallel processing (mpp) machines?

0 Answers  


IN A TABLE CAN WE USE PRIMARY KEY IN ONE COLUMN AND IN ANOTHER COLUMN BOTH UNIQUE AND NOT NULL CONSTRAINS.IF YES HOW?PLZ GIVE ME A EXAMPLE.

2 Answers  


how do you manage the production space. what are the proactive methods you can take ?

0 Answers  


TCS recently asked this question I have records like below Emp id Empname Salary DateTimestamp 1 AA 6000 20120609:11:30 1 AA 7000 20120609:12:30 1 AA 8000 20120609:01:30 I want to exceute records max timestamp(20120609:01:30)

2 Answers   TCS,


Can we take collect stats on Dervied Tables and Volitable tables, What is Golabal Temporary table what is the use of this Golabal Temporary table ,When we create any kind table in Teradata it will show in Golabal Temporary table

6 Answers   IBM,


How can we pass Variable in Bteq with out using shell script Is it possible or not If possible let me know how can we pass varaibale

1 Answers  


Categories