Subsonic generate invalid JOIN query

join;subsonic

I'm new to SobSonic and trying to create a join query for two tables. I found the options LeftInnerJoin, which generate the query that seems valid. When trying to run it on MSSQL 2005, it does not work since LEFT INNER JOIN is not valid, but LEFT JOIN.

and I'm still looking for way to generate query for joining mutiples tables and output multiples table.

Best Answer

You want a query similar to the following:

MyFirstTableCollection myFirstTables = DB.Select().From(MyFirstTable.Schema)
  .InnerJoin(MySecondTable.Schema)
  .ExecuteAsCollection<MyFirstTableCollection>();

If you want to return all the columns from both of the tables (output multiples table) however you should probably create a View which has all the columns you require and query that.