Returning first non null value in single expression
Hi,
I have the following table structure with data:
ID Order Date Order #
1 07-Aug-11 1
1 2
1 3
1 4
2 15-Aug-11 1
2 2
2 3
2 4
2 5
2 6
How do I select for each distinct ID the first non null value so I would get the following returned:
ID Order Date
1 07-Aug-11
2 15-Aug-11
I know the coalesce function returns the first non null value but I have to specify at least two expressions while in my example above I only need to use one column/expression.
Thanks