Received: from pike.cs.mankato.msus.edu (haglin@Pike.CS.Mankato.MSUS.EDU [134.29.8.37]) by hub.org (8.8.8/8.8.8) with ESMTP id LAA21056 for ; Thu, 17 Sep 1998 11:47:20 -0400 (EDT) (envelope-from haglin@pike.cs.mankato.msus.edu) Received: (from haglin@localhost) by pike.cs.mankato.msus.edu (8.8.7/8.8.7) id KAA21063 for pgsql-sql@postgresql.org; Thu, 17 Sep 1998 10:46:17 -0500 From: "David J. Haglin" Message-Id: <199809171546.KAA21063@pike.cs.mankato.msus.edu> Subject: IF..THEN..ELSE To: pgsql-sql@postgresql.org Date: Thu, 17 Sep 1998 10:46:17 -0500 (CDT) Content-Type: text Hello, I'm kinda new to using PostgreSQL, and am somewhat mystified by what appears to me to be a lack of a feature. Specifically, I would like to be able to use an IF function in a SELECT, such as: SELECT key, IF (attr1>attr2, attr1, attr2) AS maxOfAttrs INTO TABLE temp FROM basic; where the temp database would have a new column holding the larger of the two attributes for each instance. Is there an easy way to accomplish this that I am not seeing? Thanks in advance for any help, David -- David J. Haglin David.Haglin@mankato.msus.edu Mankato State University http://pike.cs.mankato.msus.edu/~haglin P.O. Box 8400 Voice: (507) 389-5306 Mankato, MN 56002-8400 Fax: (507) 389-6376 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%