Questions tagged [ranking]

Ranking is the sorted order of an element in a list of elements. Usually a high ranking means the element is good in terms of certain metric.

is used in:

  • sorting algorithms
  • information retrieval to represent the relevance of documents with respective to the search queries.
  • recommendation to rank top-k items.
1634 questions
0
votes
1 answer

MySql update with low cost CPU

I am implementing a leader board in my application, I want to update it every few time. For that I created two tables of leader boards, that each one looks like this: user_id, score, rank and this is my update query: select score from leaderboard…
Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216
0
votes
2 answers

User ranks: how to do it without SQL?

I am developing server-side part of an online game and one of the tasks is to compute user ranks. At the moment its done using RDBMS, but it updates each user row every time some player wins a game. It results in deadlocks now, when there are 20…
Denis Kulagin
  • 8,472
  • 17
  • 60
  • 129
0
votes
1 answer

selecting value in some column based on maximum value in other column

I have a table XYZ as +------+------+------+-----+ | X1 | x2 | x3 | x4 | +------+------+------+-----+ | a | b | c | 1 | | a | b | d | 2 | | p | q | e | 3 | | p | q | f | 4 …
Icarus
  • 415
  • 4
  • 12
0
votes
1 answer

Transact-SQL rank (sort) the raw votes

I got stuck while developing an algorithm to sort the raw votes. The votes table looks like this: CREATE TABLE [dbo].[Votes]( RecordId int IDENTITY(1,1) NOT NULL, FirstNameId int NOT NULL, SecondNameId int NOT NULL, FirstPreferred bit…
Paul
  • 25,812
  • 38
  • 124
  • 247
0
votes
1 answer

MySQL ranking with pagination

I have an SQL query that looks like: SELECT member_id, Count(*) AS '# of Rounds' FROM score,cup_point WHERE session_id =? AND tour_id =? AND cup_point_id = `cup_point`.id GROUP BY member_id ORDER BY Sum(points) DESC LIMIT 50…
Zahymaka
  • 6,523
  • 7
  • 31
  • 37
0
votes
1 answer

How can a developer make an online ranking system for his game?

I've been working on my game MilkyWay which is free for android platform. I wanted to know how can I make a worldwide ranking system for my users. The game is simple and the users will simply be ranked upon their score. The user should just be…
hasankamal
  • 317
  • 2
  • 7
0
votes
3 answers

MySQL sort adding progressive id

i have a problem i want to sort my table content with MySQL, and use results as ranking table in a game: scores: user | points i have this query: SELECT * FROM scores ORDER BY score DESC LIMIT 0,10 how can i add a column in my query result to…
BackSlash
  • 21,927
  • 22
  • 96
  • 136
0
votes
2 answers

Using a SQL Ranking Function with a derived column

I am trying to use a SQL Server 2008 Ranking Function on a query sorted by a derived column. Here's an example SELECT table.FirstName, table.LastName, CalculatedValue(table.number) As Points, ROW_NUMBER() OVER (ORDER BY points) AS…
Randy Burgess
  • 4,835
  • 6
  • 41
  • 59
0
votes
1 answer

MySQL ranking items: is it better to count rows in a subquery or COUNT(*) WHERE foo > bar?

The problem I'm looking at the ranking use case in MySQL but I still haven't settled on a definite "best solution" for it. I have a table like this: CREATE TABLE mytable ( item_id int unsigned NOT NULL, # some other data fields, item_score int…
Luke404
  • 10,282
  • 3
  • 25
  • 31
0
votes
3 answers

PHP MySQL Top 5 Referers Function

I have a table called users which looks like: -id -email -login -admin -coins -cash -premium -IP -pass -ref -signup -online -promote -activate -banned -rec_hash -country -c_changes -sex -daily_bonus If say user with id 81 referred 10…
CustomNet
  • 732
  • 3
  • 12
  • 31
0
votes
2 answers

Does MySQL maintain the order of the table you are querying

I'm using MySQL and I have a table that holds player scores, with a single player being able to log multiple scores. I'm trying to find the best way to rank the players using the MySQL ORDER BY keyword. Right now what I'm doing is: SELECT DISTINCT…
Russbear
  • 1,261
  • 1
  • 11
  • 22
0
votes
2 answers

SQL query to get user ranking

I'm trying to perform a query in Mysql to obtain the all time ranking of a user. For ranking of the month I managed to do it with the following request: SELECT MAX(x.rank) AS rank FROM (SELECT t.id_user, @rownum :=…
darkheir
  • 8,844
  • 6
  • 45
  • 66
0
votes
3 answers

Basic ranking of MySQL data and printing result with php

I have a table which in which I want to rank rows where one of the columns equals a value I have defined. For example in this table I want to get all rows where Col1 = a, then find what is the rank of the row in which Col3 = Ross (ranked by score in…
ajcw
  • 23,604
  • 6
  • 30
  • 47
0
votes
2 answers

rank values strategies in scala collection

I search the best way (i don't find this into current api, but perhaps i mistake) to compute different type of ranking for scala collection like IndexedSeq (like this different strategies in R :…
reyman64
  • 523
  • 4
  • 34
  • 73
0
votes
3 answers

Identifying accurate matches from SQL Server Full Text Search

I am using SQL Server 2008 Full Text Search, and joining to the FreeTextTable to determine ranking of results. How do I determine whether the result set is giving an accurate match or not? For example, for one search I may get these…
mrstumpy
1 2 3
99
100