Tuesday, January 21, 2014

In one table we have 'GENDER' column, while data migration, we updated 'GENDER' column wrongly(inplace of M, we updated F .inplace of F, we updated M), I need a query to correct this..

We need to write three queries, to solve this problem.
Table Name = EMP
Column name = GENDER
1) Update EMP set GENDER='TEMP' where GENDER= 'M'
2) Update EMP set GENDER='M' where GENDER= 'F'
3) Update EMP set GENDER='F' where GENDER='TEMP'

1 comment:

  1. Hey Ravi nice to see that u started writing the blog keep going.. :)

    ReplyDelete