From: Andres Olarte <olarte.andres@gmail.com>
To: vbhatia@ksu.edu <vbhatia@ksu.edu>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: mathematical calculations - sql queries
Date: Sun, 29 Jul 2007 20:38:46 -0600
Message-ID: <3fccaa690707291938s437884bsbcd923160b0a097c@mail.gmail.com> (raw)
In-Reply-To: <1185761260.46ad47ec4a9b7@webmail.ksu.edu>
References: <1185761260.46ad47ec4a9b7@webmail.ksu.edu>
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 <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
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: olarte.andres@gmail.com, vbhatia@ksu.edu, pgsql-jdbc@postgresql.org
Subject: Re: mathematical calculations - sql queries
In-Reply-To: <3fccaa690707291938s437884bsbcd923160b0a097c@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox