Archives of the TeradataForum
Message Posted: Mon, 25 Feb 2013 @ 10:08:59 GMT
How we can find minimum of 3 or more columns other than using nested CASE?
I want to find minimum of records in a row not in entire table.
Currently I am using nested CASE, but it will be very complicated when we need to find min of more columns
Is there anything better than below -
Case When (Col1 <= Col2) And (Col1 <= Col3) Then Col1 When (Col2 <= Col1) And (Col2 <= Col3) Then Col2 Else Col3 End
If columns to be compared are more, it will be complicated.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 27 Dec 2016|