postgresql: join analog

Example:

I have database «WAR» with two tables:

a_table

id guildId guildName
0 100500 RealGods
1 22115 BestPlayers
... ... ...

b_table where fields «attackerGuild» and «defenderGuild» are foreign keys from a_table.

id attackerGuild defenderGuild
0 1 0
1 5 6
2 ... ...

 

I want to make select and see guildId of attacker and defender.

select a."attackerGuild", b."guildId", a."defenderGuild", c."guildId" from «a_table» a, «b_table» b, «b_table» c where (a."attackerGuild" = b."id" and a."defenderGuild" = c."id");

Now i have table:

acctackerGuild guildId defenderGuild guildId
1 22115 0 100500
5 33421 6 895656
... ... ... ...