I was thinking that maybe a CASE clause may work but case is often based
on the contents of column - not a selection or host variable.

For example if you have a table that looks like this
item
sales2009
sales2008
sales2007
...
you want to do something like
case :hostvar
when '2009' then sum(sales2009)
when '2008' then sum(sales2008)
end;

I am not sure this can be done. Has your DBA heard of something called
"Third Normal Form"?

Rob Berendt

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.