SELECT
a.mon$user,
m.mon$transaction_id,
m.mon$attachment_id,
'delete from MON$ATTACHMENTS where mon$attachment_id = '||m.mon$transaction_id||';' as SQL
from mon$transactions m, MON$ATTACHMENTS a
where m.mon$transaction_id = 141994776
and a.mon$attachment_id = m.mon$attachment_id
order by 1