thenone
asked on
sql statement
mysql 5.0
correct sql statemnt to change a column from yes to no
correct sql statemnt to change a column from yes to no
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
and if I do not have a primary key?
>and if I do not have a primary key?
how do you identify the row to update then?
how do you identify the row to update then?
UPDATE `yourtable` SET `thecolumn` = 'no' WHERE `thecolumn` = 'yes'
This will update everything - regardless of the id
This will update everything - regardless of the id
ASKER
and if I was doing it with a recordset?
ASKER
ok so if I have a recordset where it is rs.open"select * from table1 where column=no"
then when I am looping through my records how can I have the recordset be able to change that column one at a time from no to yes.
then when I am looping through my records how can I have the recordset be able to change that column one at a time from no to yes.
rs.open "select * from table1 where column=no"
while not rs.eof
rs.fields("column").value = "yes"
rs.update
rs.movenext
wend
rs.close
while not rs.eof
rs.fields("column").value = "yes"
rs.update
rs.movenext
wend
rs.close
ASKER
so just this?
rs.fields("column").value = "yes"
ok thanks.
rs.fields("column").value = "yes"
ok thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER