Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > using calculate...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 9 Topic 3533 of 3799
Post > Topic >>

using calculated column in where-clause

by pittipatti@[EMAIL PROTECTED] (Patrick Scharrenberg) Jun 17, 2008 at 10:46 PM

Hi!

I'd like to do some calculation with values from the table, show them a
new column and use the values in a where-clause.

Something like this
select a, b , a*b as c from ta where c=2;

But postgresql complains, that column "c" does not exist.

Do I have to repeat the calculation (which might be even more complex
:-) ) in the "where"-clause, or is there a better way?


Thanks in advance.

Best regards
Patrick

-- 
Sent via pgsql-sql mailing list (pgsql-sql@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
 




 9 Posts in Topic:
using calculated column in where-clause
pittipatti@[EMAIL PROTECT  2008-06-17 22:46:08 
Re: using calculated column in where-clause
akretschmer@[EMAIL PROTEC  2008-06-17 23:10:41 
Re: using calculated column in where-clause
pittipatti@[EMAIL PROTECT  2008-06-18 07:31:32 
Re: using calculated column in where-clause
scott.marlowe@[EMAIL PROT  2008-06-17 15:15:13 
Re: using calculated column in where-clause
fhevia@[EMAIL PROTECTED]   2008-06-18 16:35:48 
Re: using calculated column in where-clause
scott.marlowe@[EMAIL PROT  2008-06-18 14:47:08 
Re: using calculated column in where-clause
fhevia@[EMAIL PROTECTED]   2008-06-19 15:23:48 
Re: using calculated column in where-clause
fhevia@[EMAIL PROTECTED]   2008-06-19 15:32:53 
Re: using calculated column in where-clause
tgl@[EMAIL PROTECTED] (T  2008-06-19 14:38:24 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Dec 2 21:33:00 CST 2008.