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

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


Please Help Members By Posting Answers For Below Questions

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

1122


Can you connect multiload from ab initio?

1282


Explain teradata utilities. What is multiload, fast load, tpump?

1049


What are the different design perspectives used in teradata?

1035


Describe the set operators in teradata.

1049


If a Node is busy what are the steps you can take to avoid ?

2457


What are the steps involved in the process flow of the sql statement through channel attached system?

1161


What are the things to be considered while creating secondary index?

1141


What are aggregate tables? How do you design them using teradata?

1221


What are the different methods ot loading a dimension table? A fact table etc?

1084


What is the use of stored procedures in teradata?

1046


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?

2192


Difference between stored procedure and macro?

1221


What are the updated features of teradata?

1091


What are the functions of a teradata dba?

1126