Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. (select count(*) from fight where fight.winner_id = user_id) as w,
  2. (select count(*) from user_fight INNER JOIN fight ON (fight.id = user_fight.fight_id and user_fight.user_id = user_id and fight.draw = 1 ) as d,
  3. (select count(*) from user_fight INNER JOIN fight ON (fight.id = user_fight.fight_id and user_fight.user_id = user_id and fight.winner_id != user_id ) as l
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement