Kristoff1875 Posted March 30, 2014 Share Posted March 30, 2014 I have a few tables: Results, Races and Users. Users has "UserID" indexed, Races has "RaceID" indexed and the plan was to use Results to grab it all together. Issue is each Result has 24 places and I wanted to call the user ID's for each position, so P1 and then link it to a UserID all the way to 24. When trying to do this though i'm getting the error: Too many key parts specified; max 16 parts allowed Does anyone have any idea of how I can get around this? Quote Link to comment Share on other sites More sharing options...
Barand Posted March 30, 2014 Share Posted March 30, 2014 You have a raceID and place. Why would you need more than 2, let alone more than 16? Quote Link to comment Share on other sites More sharing options...
Solution kicken Posted March 30, 2014 Solution Share Posted March 30, 2014 It sounds like you are trying to have one column per position in your results table. This is an incorrect approach to the problem. Instead you should have another table that only has three columns: ResultID, Position, UserID. Your result table would hold information relating to the result such as it's date/time or whatever else. Then the second table would have one row per position to link all the users to the result with the appropriate placement. Quote Link to comment Share on other sites More sharing options...
Kristoff1875 Posted March 30, 2014 Author Share Posted March 30, 2014 You're both right... I actually had it planned out like that and I'm trying to implement it wrong! Many thanks for pointing out my stupidity!! Quote Link to comment Share on other sites More sharing options...
Kristoff1875 Posted March 30, 2014 Author Share Posted March 30, 2014 (edited) Just a quick one then if you could... How would I go about making each result unique? For example so that only 1 User can finish in 3rd place per race, and so that each UserID can only be in each result once? Ignore that, think i've done it now. Edited March 30, 2014 by Kristoff1875 Quote Link to comment Share on other sites More sharing options...
Kristoff1875 Posted March 30, 2014 Author Share Posted March 30, 2014 Guys would you be able to shed any light on my next problem? In the results table i've got a UserID appearing twice, each one has it's relative finishing result, for example 1 and 5 for first and fifth. Have you guys got any idea on how I should calculate those in to a total of points? For example If first position received 10 points, second received 9 and so on, to calculate the total points? Quote Link to comment Share on other sites More sharing options...
Barand Posted March 30, 2014 Share Posted March 30, 2014 points = 11 - position Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.