sql: how to select all records with field set to 0 and set the value of that field to one -


is possible in 1 sql statement? pointer nice sql tutorial on subject appreciated. know can use command select * mytab myfield = 0 , use server script go through result , update myfield of result rows.

wouldn't work?

update mytab set myfield=1 myfield=0

edited add:

if interested in sql tutorials, lightweight 1 has nice feature of allowing edit , run sql commands in webpage see how work w3schools here: http://www.w3schools.com/sql/


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

Fatal error: Call to undefined function menu_execute_active_handler() in drupal 7.9 -

python - RuntimeWarning: PyOS_InputHook is not available for interactive use of PyGTK -