In my photography class I had the privilege of using a "view camera," the first of camera designs ever, it has some nifty functions that today's fancy point and shoots can't even imagine. Wikipedia, as usual, has an excellent article describing them, with a section talking about the tilt or swing technique I used in the photo below of my classmates in NJIT's Eberhard Hall.
Notice what is in focus, and what is not in focus.
Yes, the entire plane of the wall is in focus (both near and far), but everything else is not. It was achieved by angling the film plane and the lens plane so their extensions intersect the wall on a line.
Above is an ironically completely blurry photo of the setup..
See dynamics in the image below, it was taken from this website explaining them.