Use case for update the table value using sql query
Ex. table Gender_tbl and like this
id Gen_Name
1 Male
2 Male
3 Female
4 Femal
5 Male
no I have to update Gen_Name Male with M and Femal with F
solution:
UPDATE GENDER_TBL SET Gen_Name= (CASE WHEN (Gen_Name='Male') THEN 'M' WHEN (Gen_Name='Female') THEN 'F' else ' ' end)
Posted by Dilip Kumar
Sunday, January 11, 2009
Subscribe to:
Post Comments (Atom)
1 comment:
Really Helpful..Keep it up!!
Post a Comment