From: Richard Huxton <dev@archonet.com>
To: Együd Csaba <csegyud@freemail.hu>
To: pgsql-sql@postgresql.org
Subject: Re: Join or Where?
Date: Thu, 26 Jun 2003 14:09:01 +0100
Message-ID: <200306261409.01688.dev@archonet.com> (raw)
In-Reply-To: <003301c33bd5$198f7250$230a0a0a@compaq>
References: <FF851C7EEB75954F9BCFB5CA117AB1EC61A446@delta.nulinkinc.com>
<003301c33bd5$198f7250$230a0a0a@compaq>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dev@archonet.com, csegyud@freemail.hu
Subject: Re: Join or Where?
In-Reply-To: <200306261409.01688.dev@archonet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox