Hi,
I have a table like :
CREATE TABLE [ProductCategory] (
[ProductCategoryID] [int] IDENTITY (1, 1) NOT NULL ,
[ProductCategoryName] [varchar] (200) NOT NULL ,
[ProductCategoryDescription] [varchar] (500) NULL ,
[ProductCategoryHierachyID] [varchar] (100) NULL
)
and without going into too much detail I need to generate a query like this (it returns a hierachy of categories):
select p2.productCategoryID
from
productcategory p
join productcategory p2 on p2.productcategoryhierachyid like p.productcategoryhierachyid + cast(p.productcategoryid as varchar) + '%'
where
p.productcategoryid = @SomeID
My question is, as there is obviously no relationship able to be defined along the lines of the filter specified in the Join clause, is there anyway to get LLBLGen to produce this query for me? Is there anyway to get a table to join to itself without having defined a relationship?
Thanks,
Matt