The fitting you need is a union.
I'm replacing some pipe in my garage that feeds water to the sprinkler system and a garden hose faucet. I bought some galvanized 3/4 inch fittings that I can put together to fit the space. I started with the water feed pipe and inserted a T to branch to the sprinkler connection and also to the faucet pipe as it goes into the wall. The faucet pipe I can rotate to get the threads tight but the sprinkler connection is fixed, as is the water feed at the other end of the assembly.
How do I tighten the pipe connecting to the sprinkler pipe? If I screw it into the final connection it unscrews from the other end!
Is there a special connector to handle this?
Ah, right you are. Didn't see union fittings before.
You could also use a left-right fitting, where the threads are reversed on one side, but I think those are more typically used in gas lines where unions are not allowed.