pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Srinivas Kotapally <ksrinivas@coriendo.com>
To: vbhatia@ksu.edu
To: pgsql-admin@postgresql.org
Subject: Re: [JDBC] mathematical calculations - sql queries
Date: Mon, 30 Jul 2007 06:54:43 -0400
Message-ID: <022001c7d298$0a054d10$3221a8c0@srinilaptop> (raw)
In-Reply-To: <1185761260.46ad47ec4a9b7@webmail.ksu.edu>
References: <1185761260.46ad47ec4a9b7@webmail.ksu.edu>

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




view thread (3+ messages)

Message-ID: <022001c7d298$0a054d10$3221a8c0@srinilaptop>
Permalink:  ../022001c7d298$0a054d10$3221a8c0@srinilaptop/
Also on:    postgresql.org/message-id/022001c7d298$0a054d10$3221a8c0@srinilaptop

 · 

reply

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: ksrinivas@coriendo.com, vbhatia@ksu.edu
  Subject: Re: [JDBC] mathematical calculations - sql queries
  In-Reply-To: <022001c7d298$0a054d10$3221a8c0@srinilaptop>

* 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