4 ms·
Two benefits: 1) The flow is clearer: take this, then transform this, then filter this 2) CTEs makes it easy to debug parts. You just change what you select f
by fifilura 2y ago
Two benefits:
1) The flow is clearer: take this, then transform this, then filter this
2) CTEs makes it easy to debug parts. You just change what you select from on the last line.
Number 2 is the kicker IMO
- disgruntledphd2 2y agoAnd this is why you should always, always have a `final` CTE and the last line should be `select * from final` so that you can easily change this. We use a LOT of SQL at $current_dayjob and I almost always end up adding this to the queries. Clearly I need to do a better job of evangelising my approach.
- deleted 2y ago[deleted]