support selecting from multiple tables, subqueries and with aliases