Quantcast
Viewing all articles
Browse latest Browse all 207

Define a function on the fly as with CTE in MySQL

With CTE it is possible to define 'on he fly' custom tables that exists only during the execution of the current query: is it possible to do the same for functions?

Example use case

I have a query with complex where conditions that i have to replicate in the group by section of the query so it would be great to encapsulate this grouping logic in its own portion of code and be reused anywhere is needed, exactly as with CTE.


Viewing all articles
Browse latest Browse all 207

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>