Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id E44069FB53B for ; Sun, 29 Jul 2007 23:38:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 76606-05 for ; Sun, 29 Jul 2007 23:38:48 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.190]) by postgresql.org (Postfix) with ESMTP id 4ED639FB519 for ; Sun, 29 Jul 2007 23:38:48 -0300 (ADT) Received: by rv-out-0910.google.com with SMTP id f1so284904rvb for ; Sun, 29 Jul 2007 19:38:46 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=cb7dkDY5C2HQ0pDKkc8UvJOXF8CYyrrQA5dduQ6tdrEEpCkRg5rT3XQMxAIgyfcZu/SUzTT0JbT+RBb0cqc06yDtoETGmctDMFqatyIRjuhcxEl+Qo80nCBFgTjHSyZVgSOfkn98jaesgDXN3H7Pq00x6AfYYqCSFCOznPfFAFM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rVnpDSjeNcnfQIBUb3gTLWgkHesX1FyKyvYABt0whjcKFd9FihMetdf/8YyTjWiW7KAHK+aDsnbzXqydmbapAm18/MXowKP8QQRUezLi/HrfkF+9RAYIg1roZc/sTfLX2sWCOFoyA7CbL2L5asO16laEbgaPaiABzeKSs+ak9j4= Received: by 10.141.21.19 with SMTP id y19mr1681104rvi.1185763126694; Sun, 29 Jul 2007 19:38:46 -0700 (PDT) Received: by 10.141.63.6 with HTTP; Sun, 29 Jul 2007 19:38:46 -0700 (PDT) Message-ID: <3fccaa690707291938s437884bsbcd923160b0a097c@mail.gmail.com> Date: Sun, 29 Jul 2007 20:38:46 -0600 From: "Andres Olarte" To: "vbhatia@ksu.edu" Subject: Re: mathematical calculations - sql queries Cc: pgsql-jdbc@postgresql.org In-Reply-To: <1185761260.46ad47ec4a9b7@webmail.ksu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1185761260.46ad47ec4a9b7@webmail.ksu.edu> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/137 X-Sequence-Number: 17311 Sure, this is not a jdbc question, but it's fairly easy: INSERT INTO table2 (col_name2) SELECT power(col_name1,3) FROM table1; On 7/29/07, vbhatia@ksu.edu wrote: > 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 >