var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Similar to COALESCE function
I have three fields in a table say [F1, F2 & F3]. I need to fetch anyone of these three fields which has the maximum value between them.
In Simple words i'm looking for some function which is similar to COALESCE function which returns the first NOT NULL value of the fields that were passed as arguments.
FYI I'm using SQL Server 7.0 which does not supports UDF's
Earlier response appreciated
Thanks and Regards
My first inpulse would be to use a case statement:
select case when F1>f2 and f1 > f3 then F1
when F2>f1 and f2 > f3 then F2
when F3>f2 and f3 > f1 then F3
talk2cs, Your explanation is inconsistent.
Do you want the field with the maximum value, or do you want the firt non-null value? Those are two different algorithms.
Yeah DMWCincy solution fixed my problem, thanks a lot.