Received: from woody.aiinet.com (mail1.aiinet.com [38.195.69.30]) by hub.org (8.9.3/8.9.3) with ESMTP id RAA66292 for ; Tue, 12 Oct 1999 17:59:25 -0400 (EDT) (envelope-from scottsa@aiinet.com) Received: by mail2.aiinet.com with Internet Mail Service (5.5.2448.0) id ; Tue, 12 Oct 1999 17:59:08 -0400 Message-ID: <7283DE19D141D111AD0E00A0C95B195502488712@mail2.aiinet.com> From: "Saltsgaver, Scott" To: "'pgsql-sql@postgreSQL.org'" Subject: Converting column values on a select Date: Tue, 12 Oct 1999 17:59:02 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="iso-8859-1" I was wondering if it is possible to convert a text value to an integer value on a select to a table using another table as a conversion. I looked into the "create rule" call but can't seem to get it to work. Of course the code uses the numerical values for the status but I thought it would be nice if users who performed queries against that network equipment tables could see the nice text for the status. If it is possible to convert the text to a numerical is the reciprocal also possible so again the code does not have to perform Here is the status conversion table: statusValue statusText 2 normal 4 critical 7 major I then have a table that contains network equipment. network_equp_id status location contact 20 normal 2nd floor Joe 19 critical basement Fred Thanks, Scott Saltsgaver