Notes with Cards in different Decks — how to find them?

I have an Archive deck with thousands of cards that could be deleted — except that some Notes in this Archive deck also have Cards in current decks, that are still being studied.

If I delete the Archive deck, those Cards would be gone as well …

What would be the quickest way to find these Notes (that have cards in various, different decks), to exclude them from deletion?

I would use tags since they work on the note level:

  1. Select your active cards (with -deck:Archive or whatever is appropriate for your setup).
  2. Assign a unique tag, say ~active.
  3. Search for deck:Archive -tag:~active and delete these notes.
  4. Delete the new tag since it will become useless as soon as you move a card again.