If you have some links between fields auto_patient_id
and folder_id
you can try something like this
UPDATE werte
SET werte=(SELECT Date_Enrollment
FROM THKON01.data
WHERE (your_link))
WHERE number=4;
here your_link
can be of THKON01.data.auto_patient_id = werte.somefield
or THKON01.data.auto_patient_id = somefunction(werte.folder_id)
It will select only one record at a time and update all your records that fall under outer where condition.
update
if you want to use some bash script you can use smth like this
$folder_id = 1 # or some other start number
mysql -e "SELECT Date_Enrollment FROM THKON01.data" | while read Date_Enrollment; do
mysql -e "update werte set werte = $Date_Enrollment where folder_id = $folder_id"
$folder_id = $folder_id + 1
done
You said that your folder id are in order, so we can just add 1 each time instead of fetching them from result.
I'm absolutely not proficient with bash scripting so this script could be not working, but I hope that the idea is clear.