• We create a temp table which is then filled in with the resulting values which are then joined through a stored proc to a fixed statement.

    In this case, we would populate a temp table with the company codes that meet the desired criteria.  We then join that table to the query.  The temp table acts as a filter.

    It's much simpler than the way described in the article.