4 ms·
Why is this better than just joining an actual table that expands the codes?
by ergonaught 4y ago
Why is this better than just joining an actual table that expands the codes?
- TylerE 4y agoThere often isn’t an “actual” table.
- data-ottawa 4y agoIn this case it isn't. It's better when you need a lookup to multiple columns but will not be needed in any other query/ETL job. Might be steps in a funnel or values in a bespoke customer discount query. Some DBs do allow struct/array fields but joining against a constant CTE is portable and has low overhead.