Fixes SELECT when using multiple tables as inputs
Implements `SELECT * FROM a, b WHERE a.col=b.col;`