Re: Join or Where?

From: Richard Huxton <dev(at)archonet(dot)com>
To: Együd Csaba <csegyud(at)freemail(dot)hu>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Join or Where?
Date: 2003-06-26 13:09:01
Message-ID: 200306261409.01688.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thursday 26 Jun 2003 12:21 pm, Együd Csaba wrote:
> Urgent Help : Use of return from function/procedure.Hi,
> could anybody tell me what can be the difference between these queries?
> There are a big difference but I can't understand the reasons. For some
> reasons the firs query calculates getup column in a wrong way. It allways
> devides with 10. (???) While the getupquantity column comes well.
>
> With the second query everything is ok.

1 > select (select getupquantity from t_products where id=productid) as
2 > getupquantity,
3 > quantity,
4 > (select quantity/getupquantity) as getup
5 > from t_stockchanges, t_products
6 > where (getupquantity<>0)
7 > limit 30;

I don't think the t_products in the first line is the same as that in the
fifth line - that'd surely mess up your values.

--
Richard Huxton

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bruce Young 2003-06-26 15:05:44 contrib/tsearch - chopped words?
Previous Message Bruno Wolff III 2003-06-26 12:49:29 Re: Change the behaviour of the SERIAL "Type"