Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Find me CTEs in mysql or sqlite. I dare you.

And of course you can do it all inline. For transactional uses, that is probably best anyway. But there are clear use cases where inline queries are significantly less readable. Imagine subqueries nested 6 levels deep...CTEs allow you to flatten it such that you can linearly read the buildup of the query from top to bottom. It also allows the optimizer additional room for optimization, as it allows the optimizer to decide based on its analyze data whether the query is best run inline or by creating temp tables.



Ok, another reason to never use mysql.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: