|Star Trek: The Episode Guide
This search facility will list all episodes where the search criteria matches. You can search for one of the below listed items, and will then be given a list of matching episodes.
Once you have found a bunch of episodes, you can either refine your search by making a new search among the already found episodes, or you can add to your found episodes.
A refinement will allow you to find episodes where both Q and Vash are starring by first searching for episodes with the Role "Q" and then select "Search among these episodes" on the episode list that is shown. Then search for the Role "Vash" and you will find all episodes that stars both Q and Vash.
An addendum will allow you to find episodes that stars either Q or Vash by doing the same, except that you select "Add to these episodes" on the resulting list after having searched for Q.