Compare values of two columns then select the larger value

 I have a Table with 2 columns 
For example:
column1  column2 
 12      3       
 15      5       
I need to fix the max value of the 2 columns
SELECT column1, column2,
       (CASE WHEN column3 > column4 THEN column3 ELSE column4 END)
  FROM Table1
A very nice SQL Tool
http://sqlfiddle.com/

No comments:

 Python Basics How to check the version of Python interpreter mac terminal

Popular in last 30 days