Hello all.

 

I have been given an access database and am converting in into a CF web
app.  There are some queries that I need to mimic which use pivot tables
and I am having trouble figuring out the best way to get the results
that are required.

 

Here is the scenario:

One view with the following cols

 

Username         App      AppCount

A                      mail      4

A                      mail      2

A                      web      2

B                      mail      1

B                      mail      2

B                      web      2

B                      other     1

C                      mail      1

D                      web      2

 

Now I need a result that uses the App field as a column, username one
for each row and values of each row is the sum(count)

 

Like this

 

user      mail      web      other     

A          6          2

B          3          2          1

C          1

D                      2

 

I am running this query to get the results and grouping by username.  

 

Select username, app, sum(appCount) AS rowCount

>From myTable

Group by username, app

Order by UPPER(username), UPPER(app)

 

The problem is like for row D above the 2 is placed in the mail column
where it should be in the web!  I am using Oracle 9i

 

Any help hints or pointers would be gratefully received.

 

Cheers

Martin 




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/cf_lists/message.cfm/forumid:4/messageid:246905
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to