Re: [JDBC] mathematical calculations - sql queries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx [mailto:pgsql-jdbc-owner@xxxxxxxxxxxxxx]
On Behalf Of vbhatia@xxxxxxx
Sent: Sunday, July 29, 2007 10:08 PM
To: pgsql-jdbc@xxxxxxxxxxxxxx
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


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux