Search Postgresql Archives

Duplicate counting

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

 



Hello all,

I wrote a function which counts price of product from retail price and
discount. It works. But I need to count price with tax of same
product. The best way is to use counted price and add only a tax. I
would like to do by this way:

SELECT count_price(retail, discount) AS price, count_price_tax(price,
tax) FROM foo.

But PostgreSQL reports that "price" column doesn't exist. It doesn't
exist, but is counted by first calling "count_price()" function.

Is there some way how I shouldn't count these prices twice and use
just counted price?

-- 
Jiří Němec, ICQ: 114651500
www.menea.cz - www stránky a aplikace


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux