All pastes #821784 Raw Edit

Someone

public text v1 · immutable
·published 2007-12-18 09:55 UTC
rendered paste body
mysql> SELECT * FROM players t2 LEFT JOIN tourney_info t1 ON t1.player_id=t2.id
WHERE t2.owner_id='2' and t1.tourney_id!=2 group by t1.player_id
    -> ;
+----+----------+-------+---------+------+------+------------+-----------+
| id | owner_id | name  | surname | info | id   | tourney_id | player_id |
+----+----------+-------+---------+------+------+------------+-----------+
|  1 |        2 | Test  | Test 1  |      |    1 |          1 |         1 |
|  2 |        2 | Test  |  Test 2 |      |    2 |          1 |         2 |
|  3 |        2 |  Test |  Test 3 |      |    3 |          1 |         3 |
|  4 |        2 |  Test |  Test 4 |      |    4 |          1 |         4 |
+----+----------+-------+---------+------+------+------------+-----------+
4 rows in set (0.01 sec)