I am having difficulty getting the number of days between the oldest date and the newest date, the problem I have is if I use MIN
or MAX
I have to group by a column which is an issue as I do not have a column to group by.
If my data looks like this:
2017/01/01 EXAMPLE
2017/01/01 EXAMPLE
2017/01/01 EXAMPLE
2017/01/05 EXAMPLE
2017/01/06 EXAMPLE
2017/01/06 EXAMPLE
2017/01/08 EXAMPLE
I need to add a column with a static number throughout the table so it looks like:
2017/01/01 EXAMPLE 8
2017/01/01 EXAMPLE 8
2017/01/01 EXAMPLE 8
2017/01/05 EXAMPLE 8
2017/01/06 EXAMPLE 8
2017/01/06 EXAMPLE 8
2017/01/08 EXAMPLE 8
This is probably very simple but I just cannot get it right without grouping - 8 is the number of days between the earliest day and the last day
This is for ORACLE