To copy a SQL statement from two field data in a database table
Add a new field to the table today, but want to be the same as another field in the table, because the data is too much to be implemented through the SQL statement, the following sentence is really useful.
Copy Code code as follows:
Update Jb51_temp Set B=a
Jb51_temp indicates that a is a field with a numeric value, B is a newly added field, remember to put the null table in front, if the set a=b, then your values are empty, it's troublesome to back up the database before recommending the operation.
How to add a value in a field to another field
For example, there are two fields A and B,a fields is the value is "I", b field value is "we", how to use the UPDATE statement to copy the value of B field to a, and a combination to put the original content behind. After the update a field should be "we", the B field is unchanged.
Copy Code code as follows:
Update table Set A=a+b