Comment Comment by bbatchelder This is pretty much how I already write SQL, just using CTEs. In fact I bet the most straightforward way to transpile PRSQL to SQL would be using CTEs. parent bbatchelder 3 years ago