Jump to content

Hash join: Difference between revisions

m
(added python)
Line 258:
return result
 
table1 = [(127, "Jonah"),
(218, "Alan"),
(328, "Glory"),
(418, "Popeye")],
(28, "Alan")]
table2 = [("Jonah", "Whales"),
("Jonah", "Spiders"),
("Alan", "Ghosts"),
("Alan", "Zombies"),
("Glory", "Buffy")];
 
for row in hashJoin(table1, table2):
Line 272 ⟶ 273:
{{out}}
<pre>
((127, 'Jonah'), ('Jonah', 'Whales'))
((127, 'Jonah'), ('Jonah', 'Spiders'))
((218, 'Alan'), ('Alan', 'Ghosts'))
((228, 'Alan'), ('Alan', 'ZombiesGhosts'))
((318, 'GloryAlan'), ('GloryAlan', 'BuffyZombies'))
((28, 'Alan'), ('Alan', 'Zombies'))
((28, 'Glory'), ('Glory', 'Buffy'))
</pre>
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.