vivek kumar singh vivek kumar singh - 1 year ago 53
PHP Question

update a table in mysql

I have users table in which a city column . In this some city name like some Delhi and some Goa . I want to updates it's name . like change Delhi change with Goa & Goa change with Delhi .

Answer Source
update your_table
set city = case when city = 'Delhi' then 'Goa'
                else 'Delhi'
           end
where city in ('Delhi','Goa')
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download