Subject | Re: [firebird-support] SQL question |
---|---|
Author | Martijn Tonies |
Post date | 2005-09-09T09:33:33Z |
Hello Michael,
With regards,
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
> Lets say I have a table defined as:A "cross table". No, Firebird cannot do this.
>
> CREATE TABLE TEST (
> TY INTEGER,
> AMOUNT NUMERIC(15,2) DEFAULT 0);
>
> If this contains this:
>
> 0,100
> 1,200
> 0,200
> 1,300
> 0,300
>
> An SQL statement like
>
> Select
> ty,
> SUM(Amount)
> from Test
> Group by
> ty
>
> gives me this:
>
> 0,600
> 1,500
>
>
> Can I make an SQL that returns something like this:
>
> 600,500
>
> In short - I would like to have both SUM returned on the same line...
With regards,
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com