I do not think a trigger can detect the where clause used. If
you mean prevent someone from deleting all records in a table, you
might try an INSTEAD OF trigger. One approach would be to check the
number of records that were deleted against the number of records
in the table. If they are equal, raise an error "Sorry. You cannot
delete all records in this table ...".