Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT need a query and I have been up for 24 hours coding...

Status
Not open for further replies.

glrpfi

IS-IT--Management
Nov 15, 2002
51
US
I have been coding for a billion hours or so and am missing what I am certain is an easy query....help me and its a pint of your favorite!!!

The problem:
=========

Table Persona_data

ID numeric Persona ID
IND numeric Data element number (1-data.maxrecord)
VALUE numeric

Primary Key is combination of unique ID and IND

No null values

What I'd like to be able to do is check for a
given "ind", for values that match a WHERE expression…for example, value > 1, value = 14

And having found that list, to then be able to
alter the contents of those values…not setting an absolute value, but something relative to the original VALUE.

Example of the query I need

IND=12 is the persona score {range 1-1000000}
IND=50 is the persona ranking
I need a query that will assign a persona ranking, ordered by highest score
 
I hate that feeling when you've been writing code so long that you the easy stuff gradually becomes difficult. Unfortunately, I'm a little unclear on what you are asking. As I read it you have a table, Persona_data, that has three columns, ID IND and Value.

That much makes sense. From there it gets a bit sketchy. You want a query that selects * for all records that have an IND value in a given range? Is the range passed via variables? Also, on the sort.... again I'm not sure I follow. Sorting the returned records by the value of IND is pretty simple, but resetting the value of VALUE for each record will take a sizeable loop. Do you want to actually reset the value of VALUE to rank by IND in the database, or just asign VALUE of the rank by IND in a variable? Did I say that right? Yeah, I think I did. Anyway, I would say that if you can clarify this a little it should be pretty easy to do, but realistically by the time you read this you will have probably gotten a few zzzzzzzs and you won't need the help anyway.
 
basically the ID is the unique number for each persona. There are 50 overall IND elements for each ID. We are only dealing with two here.

the IND are various data elements about each ID.

for this excercise ID.12 is the player score and id.15 is the player ranking.

so id.12.value is the actual score
id.15.value is the ranking.

the query needs to sort all id.12.values and set the corresponding id.15.values to a 1-whatever ranking based on highest score to lowest...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top