Snowflake Vs MS-SQL - Part 6 - MAX among columns
MAX among columns
Suppose if you want to get the maximum value among multiple columns. In this case, among columns Column_Date1 & Column_Date2, we want the maximum to be selected.
MS-SQL Server
You can NOT achieve this directly but using little bit tricky way.
Note: If one of the columns contains NULL then it returns the NULL value. To overcome this, you can use variation of this GREATEST_IGNORE_NULLS.
Comments
Post a Comment