def compound_fwd_query(query, rel):
    """
    Create a compound forwards query that selects the
    destination nodes, which have source nodes within
    the subquery.

    :param query: The subquery.
    :param rel: The relation.
    """
    smt = 'SELECT dst FROM %s WHERE src IN (%s)'
    return smt % (rel, query), ()