DEV Community

[Comment from a deleted post]
Collapse
 
petermurdoch profile image
PeterMurdoch

Haven't yet been acquainted with CTE's. Sounds useful but for queries like these examples the only difference to me is naming sets first instead of while you're defining them. I always build the sets first for a query, only initially selecting the count. After joining / filtering and sets are verified, I go back and select the data of interest - typically I would then convert it to an insert/update/delete.