English 中文(简体)
左宫同坐在同一桌子上,不知道如何区别他们。
原标题:LeftOuterJoin with same table - don t know how to distinguish them
  • 时间:2009-09-04 06:28:21
  •  标签:

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.

然后我使用

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

但是,这给我带来了错误:

 System.NullReferenceException: Object reference not set to an instance of 
        an object.
问题回答

暂无回答




相关问题
热门标签