Help with JOIN

Hello

I have a table with a few columns. Now, two columns are this :

winner_id, loser_id

Now what I want is all the DISTINCT players id no matter winner or loser.

so that if the table has following data:

winner_id, loser_id
1,2
2,3
1,3
4,1
2,4
4,3

i want a list like:

player_ids
1
2
3
4

Please guide me how this can be achieved, thanks !

ZH

well, can you please give me an example query ?

do a UNION on the table, once for winners, once for losers.

Wow thanks a lot, i got it.


select winner_id player_ids
  from t
 union
select loser_id
  from t