views:

256

answers:

3

I know this may have been answered but SubSonic 2.2 causes an error in the SQL provider when trying to do a Left join (Left inner join to subsonic)

instead of creating SQl like

SELECT * FROM table1
LEFT JOIN table 2 ON table1.id = table2.id

it creates:

SELECT * FROM table1
LEFT INNER JOIN table 2 ON table1.id = table2.id

and this errors as invalid SQL code.

is there a work around? As i spose you're not supporting it at all anymore?

A: 

Don't really know MSSQL Syntax, but with MySQL there are no "LEFT INNER" or "LEFT OUTER" joins. However if you change your code to a left outer join, that works (with MySQL)

SchlaWiener
this was a comment in regards to the sql generation from SubSonic.
Doug
A: 

Can i bump this as no one replied with the answer

Doug
You asked for a workaround. Instead of doing a DB.Select().From("table1").LeftInnerJoin("table2")... with SubSonic you can simply do DB.Select().From("table1").LeftOuterJoin("table2")... as I suggested and get no error.
SchlaWiener
hi Schlaweiner, an outer join and inner joing are to different things, the data will not return the same.
Doug
A: 

After contacting the subsonic mailing list it would appear i simply needed to change the order that my fields where in the inner join, after doing this it should work.

Doug