> Artur Reilin <sql...@yuedream.de> wrote:
>> CREATE TABLE [challenge_players]
>> (
>>    [player_id] INTEGER PRIMARY KEY ,
>>    [player_name] TEXT
>> )
>>
>> CREATE TABLE [challenge_wins]
>> (
>>    [round_id] INTEGER PRIMARY KEY ,
>>    [round_winner] INTEGER
>> )
>>
>> I tried to do a joined select to get the both tables together. I want to
>> sort them after how much wins a player has.
>
> select player_id, player_name, count(round_winner) player_wins
> from challenge_players left join challenge_wins on (player_id =
> round_winner)
> group by player_id
> order by player_wins desc;
>
> --
> Igor Tandetnik
>

Thanks, worked like charm. So I needed "group by" in my query too. I
should do some additional research into that :/

with best wishes

Artur Reilin
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to