You want GREATEST() <http://www.postgresql.org/docs/8.2/interactive/functions-conditional.ht ml#AEN13140> -----Original Message----- From: pgsql-general-owner@xxxxxxxxxxxxxx [mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of Emi Lu Sent: Tuesday, February 13, 2007 12:37 PM To: pgsql-general@xxxxxxxxxxxxxx Subject: [GENERAL] Function in psql to Compare two numbers and return the bigger value HEllo, I am looking for a psql method to get the bigger value of two numbers. For example, methodName(12.6, 3.8) Will return 12.6 Thanks! ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend