Subject Re: [firebird-support] Re: Nasty query construct problem
Author Lucas Franzen
Johan,

> The "artno" is used to select xxxx or yyyy for making it to two
> columns in the result.
>
> Any ideas on how to make that kind of SP? Thats new for me!
>
> Thanks for helping.
> /Johan

The problem is that you have to take care for EVERY KIND of artno you've
got since you want convert a "vertical" information (the value of artno
in your records) in a horizontal one (a column for each).

So for every distinct artno you've got, you want to have two columns
back (in your example you've got artno xxxx and yyyy and you want
columns for: xxxx nett, xxxx gross, yyyy nett, yyyy gross)

This is just impossible, columns that should be returned have to be
defined in advance.

If you really got just two artno values you can do it with a stored proc.
But before I'll write you an example it's better to ask if that's what
you want! ;-)


Regards
Luc.