I need to do the following and hope there is a statement/function that can make my life easier. I have two tables called Table1 and Table2 Table1 has 1 field called Field1 Table2 has 2 fields called Field2 and Field3 I need to move some of the value from Field1 to Field2 and some to Field3 So at the end Field1 would be empty. Is there a statement that can do the following: Go to Table1/Field1 if the value of field1 starts with xyz and ends with zyx then move it to Field2 if the value of field1 starts with abc and end with cba then move it to field3 Thank you in advance
there are some software to alter the table easily in a database , forgot the exact name of the software , just try looking in google..
The easiest way would be 2 insert or update queries and a deletion query. The first one would test your for xyz/zyx and insert or append it into Field2. The second query would do the same for abc/cba and Field3. The deletion query would then delete any records in Table 1 that were xyz/zyx or abc/cba. I fear though that your problem is more complicated than that. Is this something that you need to to regularly or one time? Why does this data have to 'move'--are you elimanating Table 1 altogether? Can you be more specific in what your data is for?
You can move da\ta from one field to another and making previous one empty by using this code INSERT ... (field_1, field_6, field_2, field_8) VALUES (value_1, value_6, value_2, value_8) and if you want more information you can gor for w3school.com.There you can find many examples.