Note that there are some explanatory texts on larger screens.

plurals
  1. POSELECT DISTINCT return duplicated values
    primarykey
    data
    text
    <p>I have 3 tables <code>players</code> <code>positions</code> <code>players_national</code></p> <p>I need to <code>SELECT DISTINCT</code> positions for <code>players_national</code> where player_positon is associated with <code>players</code> table. </p> <p>My Tables are like this: </p> <pre><code>Players Table ----------------------------------------------------------------------- | player_id player_name player_team player_position | ----------------------------------------------------------------------- 1 KAKA 12 1 2 Ronaldo 7 2 3 Adriano 10 2 Positions Table ------------------------------------------------------- | position_id position_name | ------------------------------------------------------- 1 Midfield 2 Forward Players_national Table ------------------------------------------------------------------- | player_id player_team player_national_team | ------------------------------------------------------------------- 1 12 4 2 7 4 3 19 4 My Dream output is this --------------------------------------------------- | player_national_team position | --------------------------------------------------- 4 1 4 2 </code></pre> <p>My Query is like this:</p> <pre><code>SELECT DISTINCT players. * , positions. * , players_national. * FROM players LEFT JOIN positions ON positions.position_id = players.player_position LEFT JOIN players_national ON players_national.player_id = players.player_id WHERE players_national.player_id = players.player_id AND players_national.player_national_team = 4 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload