Vishwajeet Jha
Update "Male" into "Female" and "Female" into "Male" in Gender Column of a table in single line query. ?
By Vishwajeet Jha in SQL Server on Apr 23 2015
  • Vishal Jadav
    Aug, 2016 8

    Update table set gender = (case when gender='Male' then 'Female' else 'Male' end)

    • 0
  • Vishwajeet Jha
    Apr, 2015 23

    Update table_name set Gender= case when Gender='Female' then 'Male' when Gender='Male' then 'Female' end where Gender in('Female','Male')

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS