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
Author
Message
Posted Tuesday, December 11, 2012 11:37 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, June 26, 2014 8:21 AM
Points: 11, Visits: 91
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.

regards

Mitesh







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


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: 2 days ago @ 12:12 PM
Points: 1,945, Visits: 3,180
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
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Wednesday, December 10, 2014 7:32 AM
Points: 477, Visits: 3,680
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