Subject | Re: [firebird-support] Re: Nasty query construct problem |
---|---|
Author | Lucas Franzen |
Post date | 2003-11-12T17:56:34Z |
Johan,
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.
> The "artno" is used to select xxxx or yyyy for making it to twoThe problem is that you have to take care for EVERY KIND of artno you've
> columns in the result.
>
> Any ideas on how to make that kind of SP? Thats new for me!
>
> Thanks for helping.
> /Johan
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.