January 14th, 2003, 12:02 PM
complex query: creating columns for a view out of a query
I know I can do this with a script and create a table or a summary table, but it would benefit me more if I could accomplish this by creating a view and a single sql statement instead.
I have been tasked to translate an existing access application into a web application that uses a DB2 backend.
The query for access is:
TRANSFORM First([CharValue]) AS [The Value]
SELECT [Matl], [MatGrp], [Description], First([CharValue]) AS [Total Of CharValue]
GROUP BY [Matl], [MatGrp], [Description]
This creates a query with a total of 31 columns.
Matl, MatGrp, Description, Total of CharValue and the distinct contents of the Char column which is 27 separate values.
Does anyone have any ideas on how to translate this to DB2?
<grumble>I hate access</grumble>