I need a hint, maybe someone can give an advice
I have a SELECT Statement, the structure is:
SELECT xyz FROM table where col in ( ). The is specified by the end user.
What I need is the MAX( ) and MIN( )
Basically, I want to manipulate the as a set.
Ex: ::= 2016,2018,2015,2019, MAX() would be 2019, MIN() would be 2015
My investigations so far show this to work
Creating a temp table and use it like this.
SELECT MAX(YEAR), MIN(YEAR)
FROM (SELECT 2016 AS YEAR UNION ALL SELECT 2018 UNION ALL SELECT 2015 UNION ALL SELECT 2019) TEMP
As I have to handle a list of values with a variable number of elements, this approach is not really manageable.
Does anyone has an idea how to implement this?