sql - Producing a report that measures a value, grouped by one attribute and then by another -


I have a database that has many information about games, teams, connecting fixtures, those leagues, and Various results of those fixtures I want to be able to produce a report that wants to be able to measure the performance of the team (number of wins, win / points / calculation values ​​of losses) and then I want to play this game every Played by the team and then the league and Division is grouped by

For example, name of the team Sport League Division Results Hampshire Utd Football Silver Cup 1 -

I have an information The selection of joining teams in which they live, whether they win "W", "L" has been lost, or "D" has attracted the game. I'm not sure how to set it so that it calculates the number of wins if I try to do mathematical work, then it connects each stability with the value, then win, loss, and draw:

  Team Name Sport League Division Results Grahamshaw Rugby Phoenix 3 Humpshire Reverse Football Silver Cup 1 5 Kia Ora Squash National Open 4 2   

If I set criteria for "W" I get this error

The data type mismatch in the criteria expression

I'm not sure how to create groups specifically by games, leagues, and divisions. Is it a kind of or is there any other option in access which allows me to group these values? If necessary, I will provide any other information, sorry it is not clear. Thank you.

To resolve this in SQL Server (and assuming that all the data sits in a table , Which I have called my_table_name) I suggest using the following:

  select team_name, game, league, division, SUM (case when the result = 'W' then 1 ELSE 0 END) wins, SUM (case when the result = 'L' then 1 ELSE 0 ADD loses), SUM (case occurs when result = 'D' then 1 ELSE 0 END) Team_name from your_table_name group , The game wins by the League, Division. DESC - Default ASC is    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -