List,
I've got a table looking something like this:
my_table
some_id int bla bla,
partno varchar(100),
status varchar(100),
cmup numeric(14,2),
qty int
Here a small sample of contents in my table:
some_id partno status cmupqty
1 test1
Dear Gurus,
I have a strange scenario that doesn't seem to work flawlessly. I think I
can produce a full working example if needed.
We use postgresql 7.4.5
It's something like this:
%--- cut here ---%
CREATE TABLE php_retval(id serial PRIMARY KEY, retval v
Michael L. Hostbaek wrote:
List,
I've got a table looking something like this:
my_table
some_id int bla bla,
partno varchar(100),
status varchar(100),
cmup numeric(14,2),
qty int
My SQL select statement will then group together partno, status and
aggregate
If I understand well, you want the highest cmup for each partno, that is max(cmup) grouped by partno (only).
You can achieve this with a subselect, and then you join the results whith the query you already have:
SELECT T.partno, T.status, TMP.max_cmup_for_partno, max(T.cmup) AS max_cmup, sum
On Thu, Nov 04, 2004 at 05:54:30PM +0100, Michael L. Hostbaek wrote:
> some_id partno status cmupqty
> 1 test1 stock 10.00 15
> 2 test2 incoming12.00 10
> 3 test1 incoming15.00 60
> 4 test1 incoming14.00 11
>
On Thu, 2004-11-04 at 16:54, Michael L. Hostbaek wrote:
...
> some_id partno status cmupqty
> 1 test1 stock 10.00 15
> 2 test2 incoming12.00 10
> 3 test1 incoming15.00 60
> 4 test1 incoming14.00 11
...
> My result
=?iso-8859-2?B?U1rbQ1MgR+Fib3I=?= <[EMAIL PROTECTED]> writes:
> The php connects to the database and updates retval where id=seq.
> It seems to be OK, but the function returns the value of php_retval.retval
> _before_ the call.
Yes, because your transaction is working with a database snapshot that