select distinct version_id from apm_package_files where file_id in ([join $file_id ","]) delete from apm_package_files where file_id in ([join $file_id ","])