mysql - Select rows from database then change a value in a column -


i'm using following query:

select id,link,size files status='-1' order id desc limit 10 

then want change 'status' column values of selected rows -2, possible combine 'select' , 'update' functions in same query don't have query database again?

you not need combine select update: try:

update files set status='-2' status='-1' order id desc limit 10; 

the fields names irrelevant here.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -