RANK / Position

This is a discussion on "RANK / Position" within the Databases section. This forum, and the thread "RANK / Position are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Databases

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Sep 7th, 2004, 20:26
New Member
Join Date: Sep 2004
Location: United Kingdom
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
RANK / Position

Hi
I have a query that shows a Football League Table with Points, Goal Difference, Goals for and against etc., but I don't know how to add a column for Position going by the Points and Goal Difference
Can you help please?
Cheers

  #2 (permalink)  
Old Sep 8th, 2004, 08:16
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
Could you post the query here please?
  #3 (permalink)  
Old Sep 8th, 2004, 09:16
New Member
Join Date: Sep 2004
Location: United Kingdom
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Hi - I'm at work at the moment but here is an example of what the League Table looks like

Team Points Goal Diff Goals For Goals Against
Arsenal 12 11 16 5
Chelsea 12 5 6 1
Bolton 9 3 7 4
Tottenham 8 2 4 2
Middlesbro 7 1 9 8

I need to add a Position Column sorted descending by Points then Goal Diff so it would look like

Position Team Points Goal Diff Goals For Goals Against
1 Arsenal 12 11 16 5
2 Chelsea 12 5 6 1
3 Bolton 9 3 7 4
4 Tottenham 8 2 4 2
5 Middlesbro 7 1 9 8


Thanks
JS
  #4 (permalink)  
Old Sep 8th, 2004, 09:55
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Shark.... If you post your SQL query, we could change it to return the records in the right order.

I would imagine you need to add: "Order by Points Desc, Goal Diff" to the end of your query.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #5 (permalink)  
Old Sep 8th, 2004, 21:42
New Member
Join Date: Sep 2004
Location: United Kingdom
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Rob

The query is in Access and the Team, Points, GD etc., are all in the correct order but I just need to add a Position

I tried the below using an alias for the League Table but this only sorts by Points where I need to by Points then Goal Difference
( I probably haven't explained it very well so far!! - I'm new to this)

Position: (SELECT Count(*) FROM LeagueTable WHERE [LT].[Total Pts]< [Total Pts])
  #6 (permalink)  
Old Sep 9th, 2004, 12:25
Junior Member
Join Date: Aug 2004
Location: United Kingdom
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
apologies to start, i am soooo new to all this SQL stuff but:

could you not nest this inside another selection procces, eg!

Position: (SELECT Count(*) FROM (SELECT Count(*) FROM LeagueTable WHERE [LT].[Total Pts]< [Total Pts]) WHERE [LT].[GD]<[GD])

Or is that total rubbish?!?!?!?
  #7 (permalink)  
Old Sep 9th, 2004, 21:28
New Member
Join Date: Sep 2004
Location: United Kingdom
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Didn't work I'm afraid:mad:
Closed Thread

Tags
rank, position

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Rank A Blog In Google francis84 Search Engine Optimization (SEO) 11 Jul 12th, 2008 11:27
How do i install my own rank pictures? Ghost22 PHP Forum 2 Jun 10th, 2008 22:33
Page Rank 3 stuarttodd Search Engine Optimization (SEO) 22 Jul 24th, 2007 20:15


All times are GMT. The time now is 01:27.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43