Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: mathematical calculations - sql queries



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(at)ksu(dot)edu <vbhatia(at)ksu(dot)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
>



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group