SHOW:
|
|
- or go back to the newest paste.
1 | WITH n(nodeId, alias,mastercontenttype,icon,thumbnail) AS | |
2 | - | Laatst had ik vergelijkbaar probleem waarbij ik hiearchy van documenttypes diende te queryen, uiteindelijk deze toch wel vrij pittige query voor MS Sqlserver geschreven: |
2 | + | |
3 | FROM [cmsContentType] | |
4 | UNION ALL | |
5 | SELECT nplus1.nodeId, nplus1.alias , nplus1.mastercontenttype, nplus1.icon,nplus1.thumbnail | |
6 | FROM [cmsContentType] as nplus1, n | |
7 | WHERE n.nodeId = nplus1.masterContentType) | |
8 | ||
9 | SELECT distinct cmsContentType_1.alias,n.nodeId,n.alias,n.icon,n.thumbnail FROM n | |
10 | LEFT OUTER JOIN | |
11 | dbo.cmsContentType AS cmsContentType_1 | |
12 | ON n.masterContentType = cmsContentType_1.nodeId | |
13 | order by n.nodeId |