Which One Is the Culprit?
August 8, 2007 Hey, Ted
I am using the MAX function in a SQL statement to get the maximum value from a few columns. I don’t know which element is producing the maximum value. Is there a way to identify the element that has the maximum value? –Hisham Yes, Hisham. Thanks for allowing me another opportunity to show off that most versatile of SQL features: CASE. For the benefit of the readers, here’s the SQL statement Hisham sent to me. SELECT max(WK01, WK02, WK03, WK04) FROM SALES Here’s the sort of results his SQL query generates. MAX === 100 120 150 He has the maximum |