Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Help with Grouping data Expand / Collapse
Posted Tuesday, December 11, 2012 11:37 AM


Group: General Forum Members
Last Login: Monday, March 23, 2015 5:21 AM
Points: 11, Visits: 95
Hi All

Following is my table structure with the data. I just cant work out the query to group the data by Rank & Board. I would like to generate 2 queries to do the grouping based on Rank & Board.

Please find attached the table structure and the layout of report.

I would really appreciate any help or pointers on creating this 2 report.



  Post Attachments 
ReportQuery.PNG (8 views, 29.04 KB)
Post #1395261
Posted Tuesday, December 11, 2012 1:03 PM



Group: General Forum Members
Last Login: Yesterday @ 7:41 PM
Points: 1,945, Visits: 3,470
Why would anyone open a file from, someone they do not know?

Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn to use ISO-11179 data element naming conventions and formatting rules. RANK is a reserved word! Temporal data should use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect.

This is minimal polite behavior on SQL forums. Your posting picture is both rude and useless. Where is any effort you already made?

What aggregates do you want to do on this data? We never format data for display in the database; remember what a tiered architecture means?

Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
Post #1395294
Posted Tuesday, December 11, 2012 1:26 PM


Group: General Forum Members
Last Login: Thursday, April 2, 2015 7:14 AM
Points: 478, Visits: 3,698
I can't see that what you need is more than this:

--Report 1
select Rank, Name, Board
from MyTable
sort by Rank, Name, Board

--Report 2
select Board, Name, Rank
from MyTable
sort by Board, Name, Rank

How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
Post #1395302
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse