Great question — answering as the UphillTech team:
Since you have access from underneath in a crawl space, it should be repairable. The bigger question to address is: What happened here? Did the drain pipe break or was it just not installed properly? From the photo, it looks to me like the pipe was just not attached to the drain very securely, with only 2 or 3 threads engaged. If the drain pipe is just sagging and flopping around in the crawl space then it might be an easy fix to re-attach. If the pipe is broken or settling under the building has pulled it loose, it might be a bigger problem. EDIT : I can't quite tell from the photo: I see some rusted threads in the green section I've marked, but are what I have marked in blue also threads...
Full answer by spuck: https://diy.stackexchange.com/a/306823 (CC BY-SA 4.0).
Need it done for your business? UphillTech.