Sorting Table and get Position of row
QUERY #1


  position the user 2 has if I sort by time and server = 1


SET @given_user = 2;
SET @given_server = 1;
SET @pos = 0;
SELECT * FROM
(
    SELECT (@pos:=@pos+1) pos,User
    FROM playerstats
    WHERE server = @given_server
    ORDER BY time DESC
) A
WHERE User = @given_user;


QUERY #2


  if I sort by the sum of the time of a user


SET @pos = 0;
SELECT (@pos:=@pos+1) pos,User,TotalUserTime FROM
(
    SELECT User,SUM(time) TotalUserTime
    FROM playerstats
    GROUP BY User
) A ORDER BY TotalUserTime DESC;


YOUR SAMPLE DATA

mysql&gt; DROP DATABASE IF EXISTS mydb;
Query OK, 0 rows affected, 1 warning (0.03 sec)

mysql&gt; CREATE DATABASE mydb;
Query OK, 1 row affected (0.01 sec)

mysql&gt; USE mydb
Database changed
mysql&gt; CREATE TABLE playerstats
    -&gt; (
    -&gt;     User INT,
    -&gt;     Time INT,
    -&gt;     Server INT
    -&gt; ) ENGINE=MyISAM;
Query OK, 0 rows affected (0.25 sec)

mysql&gt; INSERT INTO playerstats VALUES
    -&gt; (2, 10,1),
    -&gt; (1, 50,1),
    -&gt; (2, 60,3),
    -&gt; (1, 20,2),
    -&gt; (1,100,3),
    -&gt; (2, 70,2);
Query OK, 6 rows affected (0.03 sec)
Records: 6  Duplicates: 0  Warnings: 0

mysql&gt; SELECT * FROM playerstats;
+------+------+--------+
| User | Time | Server |
+------+------+--------+
|    2 |   10 |      1 |
|    1 |   50 |      1 |
|    2 |   60 |      3 |
|    1 |   20 |      2 |
|    1 |  100 |      3 |
|    2 |   70 |      2 |
+------+------+--------+
6 rows in set (0.01 sec)

mysql&gt;


QUERY #1 EXECUTED

mysql&gt; SET @given_user = 2;
Query OK, 0 rows affected (0.00 sec)

mysql&gt; SET @given_server = 1;
Query OK, 0 rows affected (0.00 sec)

mysql&gt; SET @pos = 0;
Query OK, 0 rows affected (0.00 sec)

mysql&gt; SELECT * FROM
    -&gt; (
    -&gt;     SELECT (@pos:=@pos+1) pos,User
    -&gt;     FROM playerstats
    -&gt;     WHERE server = @given_server
    -&gt;     ORDER BY time DESC
    -&gt; ) A
    -&gt; WHERE User = @given_user;
+------+------+
| pos  | User |
+------+------+
|    2 |    2 |
+------+------+
1 row in set (0.09 sec)

mysql&gt;


QUERY #2 EXECUTED

mysql&gt; SET @pos = 0;
Query OK, 0 rows affected (0.00 sec)

mysql&gt; SELECT (@pos:=@pos+1) pos,User,TotalUserTime FROM
    -&gt; (
    -&gt;     SELECT User,SUM(time) TotalUserTime
    -&gt;     FROM playerstats
    -&gt;     GROUP BY User
    -&gt; ) A ORDER BY TotalUserTime DESC;
+------+------+---------------+
| pos  | User | TotalUserTime |
+------+------+---------------+
|    1 |    1 |           170 |
|    2 |    2 |           140 |
+------+------+---------------+
2 rows in set (0.00 sec)

mysql&gt;


GIVE IT A TRY !!!

UPDATE 2014-12-26 15:32 EST

QUERY #3

SET @given_user = 2;
SET @pos = 0;
SELECT * FROM
(
    SELECT (@pos:=@pos+1) pos,User,TotalUserTime FROM
    (
        SELECT User,SUM(time) TotalUserTime
        FROM playerstats
        GROUP BY User
    ) A ORDER BY TotalUserTime DESC
) AA
WHERE User = @given_user;


QUERY #3 EXECUTED

mysql&gt; SET @given_user = 2;
Query OK, 0 rows affected (0.00 sec)

mysql&gt; SET @pos = 0;
Query OK, 0 rows affected (0.00 sec)

mysql&gt; SELECT * FROM
    -&gt; (
    -&gt;     SELECT (@pos:=@pos+1) pos,User,TotalUserTime FROM
    -&gt;     (
    -&gt;         SELECT User,SUM(time) TotalUserTime
    -&gt;         FROM playerstats
    -&gt;         GROUP BY User
    -&gt;     ) A ORDER BY TotalUserTime DESC
    -&gt; ) AA
    -&gt; WHERE User = @given_user;
+------+------+---------------+
| pos  | User | TotalUserTime |
+------+------+---------------+
|    2 |    2 |           140 |
+------+------+---------------+
1 row in set (0.06 sec)

mysql&gt;