test for per with subselect