Hi
I need a SQL statement which provides an overview of all documents into project workspace grouped by a certain ProjectCat attribute which only exists on projectworkspace self and not on the documents inside somehwhere in the workspaces. I have a query which works in SQL Server, but doens't work on Oracle. Anybody has a tip how to convert this one ?
Tips highly appreciated
Ludwig
WITH Parent AS
(
SELECT ParentID, DataID, CONVERT(nvarchar (256 ), Name ) AS QName , Subtype, a.ValStr "ProjectCat"
FROM DTree "t", llattrdata "a"
WHERE (t.DataID=a.ID and a.DefID = 2458659 and a.AttrID = 17 and t.VersionNum = a.VerNum )
AND Subtype = 202
UNION ALL
SELECT DT.ParentID,
DT.DataID,
CONVERT(nvarchar (256), Name ) AS QName,
DT.Subtype,
Parent.ProjectCat
FROM DTree DT
INNER JOIN Parent ON Parent.DataID = DT.ParentID
)
SELECT Parent.ProjectCat, COUNT(*) "Number of documents"
FROM parent
WHERE SubType = 144
GROUP BY ProjectCat