Subject | RE: [firebird-support] How to build Cross tabs? |
---|---|
Author | Peter Gore |
Post date | 2004-12-23T05:31:49Z |
Hi
You can perform crosstabs or pivot tables using CASE statements. For example
to sum values, do the following:-
SELECT MyGroupField,
SUM(CASE MyPivotColumn WHEN 'Criteria1' THEN MyAggregateField ELSE null END)
AS "Criteria1",
SUM(CASE MyPivotColumn WHEN 'Criteria2' THEN MyAggregateField ELSE null END)
AS "Criteria2",
...
FROM MyTable
Regards
Peter Gore
-----Original Message-----
From: Waner Miranda [mailto:wanermiranda@...]
Sent: 23 December 2004 00:00
To: firebird-support@yahoogroups.com
Subject: [firebird-support] How to build Cross tabs?
Hi,
I have a difficulty with cross tabs, the procedures build many rows, then
show these slowly. Which the best way to show and use, cross tabs with FB?
Waner Miranda
Brz
Yahoo! Groups Links
You can perform crosstabs or pivot tables using CASE statements. For example
to sum values, do the following:-
SELECT MyGroupField,
SUM(CASE MyPivotColumn WHEN 'Criteria1' THEN MyAggregateField ELSE null END)
AS "Criteria1",
SUM(CASE MyPivotColumn WHEN 'Criteria2' THEN MyAggregateField ELSE null END)
AS "Criteria2",
...
FROM MyTable
Regards
Peter Gore
-----Original Message-----
From: Waner Miranda [mailto:wanermiranda@...]
Sent: 23 December 2004 00:00
To: firebird-support@yahoogroups.com
Subject: [firebird-support] How to build Cross tabs?
Hi,
I have a difficulty with cross tabs, the procedures build many rows, then
show these slowly. Which the best way to show and use, cross tabs with FB?
Waner Miranda
Brz
Yahoo! Groups Links