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.
|
|
|
|
|
![]() |
||
RANK / Position
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
Could you post the query here please?
|
|
#3
|
|||
|
|||
|
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
|
||||
|
||||
|
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
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#5
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
Didn't work I'm afraid:mad:
|
![]() |
| Tags |
| rank, position |
| Thread Tools | |
|
|
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 |