Webforumz's RSS FeedRSS Webforumz RegistrationRegister Contact Webforumz StaffContact

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.


 Subscribe in a reader

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

Notices




Closed Thread
 
LinkBack Thread Tools
  #1  
Old Sep 7th, 2004, 21: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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #2  
Old Sep 8th, 2004, 09: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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old Sep 8th, 2004, 10: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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old Sep 8th, 2004, 10:55
Rob's Avatar
Rob Rob is offline
Webforumz Founder

SuperMember
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,190
Blog Entries: 7
Thanks: 28
Thanked 22 Times in 19 Posts
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 - Webforumz Founder

I am currently NOT available for SEO consultancy work

My Sites: Student Midwife Forum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #5  
Old Sep 8th, 2004, 22: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])
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #6  
Old Sep 9th, 2004, 13: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?!?!?!?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #7  
Old Sep 9th, 2004, 22: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:
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
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 12:27
How do i install my own rank pictures? Ghost22 PHP Forum 2 Jun 10th, 2008 23:33
Page Rank 3 stuarttodd Search Engine Optimization (SEO) 22 Jul 24th, 2007 21:15


All times are GMT. The time now is 16:07.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8