I would do this in 2 parts. I would also like to add only do this if you are very familiar with the UIM DB. If you delete something from S_QOS_DATA it will cascade and remove all RN/HN/DN data. Use at your own risk.
Part 1 - Set ci_metric_ids to null for a specific robot:
This is assuming that you already know how to clear nis cache folder of the robot in question. After running the query below, bounce discovery_server and data_engine. Depending how many devices you have in your environment, you might have to wait 5 minutes or 30+ minutes before the ci_metric_id column is populated. Run query below:
Update s_qos_data set ci_metric_id = NULL
Where robot = '<robotname>'
Part 2 - Delete NULL entries:
After sufficient time has passed you can probably assume that any existing NULL entry probably does not exist anymore. It could also mean that a device is down and since it can not be polled it can not create a new ci_metric_id. So use your best judgement. Run the following query to delete NULL rows:
delete from S_QOS_DATA
where robot = '<robotname>'
and ci_metric_id is NULL