Hello,
I'm running requests on an Oracle database. One of my tables contains time slots for Elements and there can be several time slots for the same Element so that the following example is correct :
ID ELEMENT_ID BEGIN_DATE END_DATE
--------------------------------------------
1 1 01/01/2007 01/06/2007
2 1 01/06/2007
3 2 01/01/2006 01/07/2006
4 2 01/07/2006 31/12/2006
The time slot for which END_DATE
is not filled means that it is still running (so, this is the most recent time slot for the Element).
Thus, when I search the most recent END_DATE
for each Element, I want to obtain the rows #2 and #4.
So, The problem I'm facing is to consider NULL as the highest END_DATE
...
Is it possible to do this in one single SQL request ?
Of course I tried a simple :
SELECT MAX(END_DATE) FROM ...
but it's not enought because of the NULL values.
Thanks in advance.