Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 0FB489FB739 for ; Mon, 30 Jul 2007 07:54:53 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 52785-01 for ; Mon, 30 Jul 2007 07:54:45 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.239]) by postgresql.org (Postfix) with ESMTP id AF5759FB690 for ; Mon, 30 Jul 2007 07:54:49 -0300 (ADT) Received: by wx-out-0506.google.com with SMTP id h29so1281920wxd for ; Mon, 30 Jul 2007 03:54:48 -0700 (PDT) Received: by 10.70.26.8 with SMTP id 8mr9775821wxz.1185792888559; Mon, 30 Jul 2007 03:54:48 -0700 (PDT) Received: from srinilaptop ( [72.94.185.135]) by mx.google.com with ESMTPS id i12sm2248672wxd.2007.07.30.03.54.47 (version=SSLv3 cipher=RC4-MD5); Mon, 30 Jul 2007 03:54:48 -0700 (PDT) Reply-To: From: "Srinivas Kotapally" To: , References: <1185761260.46ad47ec4a9b7@webmail.ksu.edu> Subject: Re: [JDBC] mathematical calculations - sql queries Date: Mon, 30 Jul 2007 06:54:43 -0400 Organization: BISIL NA Inc Message-ID: <022001c7d298$0a054d10$3221a8c0@srinilaptop> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcfSTpwB03GJyYB6St+A8jzTymKMdgARh/og In-Reply-To: <1185761260.46ad47ec4a9b7@webmail.ksu.edu> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/331 X-Sequence-Number: 26312 You could do a stored procedure for inserting into another table... Otherwise if you want to get the result as a query, you could do something like, Select field1, exp(field2) as expoffield2 from tablename1 Hope that helps, Srini -----Original Message----- From: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of vbhatia@ksu.edu Sent: Sunday, July 29, 2007 10:08 PM To: pgsql-jdbc@postgresql.org Subject: [JDBC] mathematical calculations - sql queries Hi all, Thanks for replying to previous mail, I have one more question. Can I write a postgresql query that retrieves a particular field from a table and performs some mathematical calculation on that field involving exponential( exp) and pow functions and storing the result in a new table. Somethign like this select field1 from tablename1 ( performing calculation on field1 ) ( storing in another table) Thanks and regards, Vishal ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match