Quantcast
Channel: Active questions tagged cte - Database Administrators Stack Exchange
Viewing all articles
Browse latest Browse all 215

Define a function on the fly as with CTE in MySQL

$
0
0

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 215

Latest Images

Trending Articles



Latest Images

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