I've not used SQL in quite a while and I'm pretty rusty it seems. I've had to do a project recently and needed to use MySQL on Windows and when looking for solutions to this particular query, I get told that you can use COUNT(*) implicitly somehow, but I can't get it to work right.
What I need is something like:
PLAYER_ID | MATCHES_WON | MATCHES_LOST |
---|---|---|
0 | 4 | 1 |
1 | 2 | 5 |
2 | 2 | 2 |
I have made a simple SQL fiddle of my database here.
Could someone help me out with this? I'm willing to accept that I might have to make a more involved solution with some CURSOR
and LOOP
but thought I'd ask here. It's my first question on this community, so sorry if I didn't format this right or it wasn't an appropriate question.