id name gender
1 Ram Female
2 Kumar Female
3 sathish Female
4 Santhya Male
5 Durga Male
6 Priya Male
This is my input...how to change Gender Male to Female &
Female to Male??? Write sql query for this question???
Answers were Sorted based on User's Feedback
Answer / yuvaevergreen
I am not sure whether decode will work in teradata 12.0 but case statement can be used.
update stud set gender =
case gender
when 'male' then 'female'
when 'female' then 'male'
end;
| Is This Answer Correct ? | 24 Yes | 1 No |
Answer / ankal
update stud set gender=
case gender when'male' then'female'
else 'male' end;
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / kumar amit ranjan
UPDATE stud SET gender ='Z' WHERE gender ='F';
UPDATE studmaster SET gender ='F' WHERE gender ='M';
UPDATE studmaster SET gender ='M' WHERE gender ='Z';
| Is This Answer Correct ? | 3 Yes | 2 No |
Answer / tdguy
update using case option is the best option for this query.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / srinu
update stud set gender= decode(gender,'M','F','F','M')
| Is This Answer Correct ? | 3 Yes | 3 No |
Answer / apurva kumar
UPDATE table
SET Gender = CASE
WHEN Gender = 'Male' THEN 'Female'
ELSE 'Male'
END
| Is This Answer Correct ? | 1 Yes | 1 No |
what is differences between Fastload and Multiload as per DBA aspect ?
What is the purpose of joins in teradata and what are the available join types?
What are default access rights in teradata?
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.
What is the difference between teradata and oracle?
What are the components provided on node?
Difference between multiload and tpump?
How do you design aggregate tables using teradata?
In general, how do you optimze any sql in teradata?
A certain load is being imposed on the table and that too, every hour. The traffic in the morning is relatively low, and that of the night is very high. As per this situation, which is the most advisable utility and how is that utility supposed to be loaded?
Highlight a few of the important components of Teradata?
hi frnds i want to learn teradata utilities and teradata dba real time. i have 1+ years of experience in teradata. so i want to go deeply in Tearada. plz let me know at my email id who r best to learn from. im lookng for a realtime guy in HYD or Banglr. Thanks in advance. Rajesh my email-id: rajeshmss87@gmail.com