I have a view from which I have to select data between 2 given dates (start date and end date).
The problem is that views in mysql can’t accept arguments (as far as I know), and I need to return the result to the calling application.
In Can I create view with parameter in MySQL? a work around for this by initializing session variable.
My question is: Is it possible to have a function that composes the query from the given arguments and then return the resultset?
You can add a WHERE condition on your SELECT FROM
custom_view, just like you with do with regular tables.