vivek kumar singh vivek kumar singh - 2 years ago 63
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'
where city in ('Delhi','Goa')
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download