a celko-puzzle from long time ago

From: stig erikson <stigerikson_nospam_(at)yahoo(dot)se>
To: pgsql-sql(at)postgresql(dot)org
Subject: a celko-puzzle from long time ago
Date: 2006-11-05 18:46:30
Message-ID: eilbl4$749$1@floppy.pyrenet.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

While reading celko's SQL puzzles (second edition) i followed a reference to http://www.dbmsmag.com/9801d06.html.
There is a puzzle that counts items in boxes.
When i try to run the proposed solution on PG 8.1.5, PG says: ERROR: column reference "qty" is ambiguous

apparently the variable declaration used in the solution is not proper for PostgreSQL. Is there a way to solve this puzzle in PostgreSQL?

/stig

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Hubert Retif 2006-11-06 11:08:36 Nested select
Previous Message imad 2006-11-05 11:59:14 Re: Create Function (SQL)