sql - MySQL: Get two rows as one -
users table:
id | win | lose 0 | 1 | 2 1 | 2 | 8
games table:
id | user1 | user2 | info 0 | 0 | 1 | 'some text'
the db simple multiplayer game. need query user2, data, and win-lose info both users. possible in mysql @ all? help appreciated.
you have join
table users
2 times this:
select u1.win win1, u1.lose lose1, u2.win win2, u2.lose lose2, ... games g inner bring together users u1 on g.user1 = u1.id inner bring together users u2 on g.user2 = u2.id
mysql sql
No comments:
Post a Comment