views:

207

answers:

0

Hi,

I would like to make a LeftOuterJoin between one table and same table, but dont know how to make the distinguish them...

SubSonic.SqlQuery q = new Select().
        From(TABLE.Schema).
        LeftOuterJoin<TABLE>();

This returns me the error: The objects "dbo.TABLE" and "dbo.TABLE" in the FROM clause have the same exposed names. Use correlation names to distinguish them.

then I use

SubSonic.SqlQuery q = new Select().
        From(TABLE.Schema).
        LeftOuterJoin("TABLE as SecondTABLE", "SecondTABLE.ID","TABLE","ID");

but this returns me the error:

 System.NullReferenceException: Object reference not set to an instance of 
        an object.

Thanx