To modify the value of a field, the original value is 1, And now it must be changed to 0. Can I understand that, as long as all data with the field value of 1 is changed to 0? If so, assume that the field to be modified is Name and the code is: 1 Update [Table Name] Set [Name] 02 Where [ID] in3 (4 Select [ID] from
To modify the value of a field, the original value is 1, And now it must be changed to 0. Can I understand that, as long as all data with the field value of 1 is changed to 0? If so, I assume that the field to be modified is Name and the code is: 1 Update [Table Name] Set [Name] = '0' 2 Where [ID] in 3 (4 Select [ID] from
To modify the value of a field, the original value is 1, And now it must be changed to 0.
Can I understand that, as long as all data with the field value of 1 is changed to 0?
If so, I assume that the field to be modified is Name,
Code:
1 Update [Table Name] Set [Name] = '0'
2 Where [ID] in
3 (
4 Select [ID] from [Table Name] where [Name] = '1'
5)
Explain the Code:
First, no matter how many data records you want to modify, you only need to make sure that all data whose field value is 1 is changed to 0, and the ID is unique, therefore, you can find all the ID values of the data you want to modify based on this condition. If the ID is unique, you can modify the field value based on the ID.
Hope to help you ~