C
Crazyhorse
I've got two tables. I want to perform a LEFT JOIN between the first table
and a subset of the second table (so that each member of table1 has no more
than one match in the subset of table2). If SQL understood my randomly
generated syntax, it would run the following:
SELECT Table1.*, Table2.*
FROM Table1
LEFT JOIN (SELECT * FROM Table2 Where Somefield=1)
ON Table1.PrimaryKey=Table2.ForeignKey
But it doesn't. So how do I perform Joins on subqueries in SQL??
and a subset of the second table (so that each member of table1 has no more
than one match in the subset of table2). If SQL understood my randomly
generated syntax, it would run the following:
SELECT Table1.*, Table2.*
FROM Table1
LEFT JOIN (SELECT * FROM Table2 Where Somefield=1)
ON Table1.PrimaryKey=Table2.ForeignKey
But it doesn't. So how do I perform Joins on subqueries in SQL??