So i have two tables which based on below :
Table : Player Code Name Address ------------------------- 001 John Miami 002 Winda Washington 003 Ferry New York 004 Chase Texas ________________________ Table : Match No Date Player1 Player2 Result 0001 01/11/17 001 003 003 0002 01/11/17 002 004 002 0003 02/11/17 001 002 001 0004 02/11/17 003 004 004 0005 03/11/17 001 004 001 0006 03/11/17 002 003 002
So based on both tables, I want to create a select query to make result like this :
No Date Winner Loser 0001 01-Nov-17 Ferry John 0002 01-Nov-17 Winda Chase 0003 02-Nov-17 John Winda 0004 02-Nov-17 Chase Ferry 0005 03-Nov-17 John Chase 0006 03-Nov-17 Winda Ferry
I was told by a friend to use not equal to operator (!=) Previously I Already made this
select b.No, b.Date, c.Name as "Winner", d.Name as "Loser" from match b, player c, player d where b.Result = c.code >> then i got stuck
Any ideas regarding below problem?
Many thanks!