3 ms·
1. Can be done using views. Creating named views is really not that different than building named functions or methods.
by ako 1mo ago
1. Can be done using views. Creating named views is really not that different than building named functions or methods.
- mike_hearn 1mo agoThey aren't the same. Views are persistent objects, not like local variables that exist only for the scope of an operation. CTEs are the closest equivalent but you can't factor out predicates that way.
- ako 1mo agoWhy does it matter? It’s like a named operation, and if you want local scope you can create CTEs, which is like an anonymous local operation. So you have both options.