[sql] How can I join on a stored procedure?