Hi all,
How do you do a self join in SubSonic using the new query object?
Here is the SQL I want to produce
SELECT Page.ProductId, Page.PageTitle, Page.PageDescription, Page.InActive, Page.NextPageId AS NextPage, Page_1.PageTitle AS NextPageTitle
FROM Page LEFT OUTER JOIN Page Page_1 ON Page.NextPageId = Page_1.Id
I do not know how you set the alias for the Table name, below is what I cribbed together
ProductBuilder.DB.Select("ProductId",
"PageTitle",
"InActive",
"Page.NextPageId AS NextPage", "Page_1.PageTitle AS NextPageTitle").From("Page").
LeftOuterJoin(ProductBuilder.Page.IdColumn,ProductBuilder.Page.NextPageIdColumn).ExecuteDataSet();
Thanks
Northern