This should be sufficient I think. I often clean things up with something along the lines of
delete from sqlt_data_X_XXXX_XX
inner join sqlth_te
where tagid = id and retired is not null
then
`delete from sqlth_te where retired is not null`
This should be sufficient I think. I often clean things up with something along the lines of
delete from sqlt_data_X_XXXX_XX
inner join sqlth_te
where tagid = id and retired is not null
then
`delete from sqlth_te where retired is not null`