Quantcast
Channel: SCN : Unanswered Discussions - Semantic Layer
Viewing all articles
Browse latest Browse all 1291

creating an universe

$
0
0

HI All,

 

I have a table with hierarchy inside. i need to create a query for datafoundationlayer.

 

i have a query but is giving an error saying invalid alias.  Can someone help me out please.

WITH TaskHierarchy (name, taskid,parentid,levelnumber,creator,userparameter2,usercomment) AS
(
  -- Base case
  SELECT
  name, taskid,parentid, 1 as levelnumber, creator,userparameter2,usercomment
  FROM task
  WHERE parentid IS NULL

  UNION ALL

  -- Recursive step
  SELECT
  e.name, e.taskid,e.parentid
  eh.levelnumber + 1 AS levelnumber
, e.creator,e.userparameter2,e.usercomment
  FROM task e
  INNER JOIN TaskHierarchy eh ON
  e.parentid = eh.taskID
)

SELECT *
FROM TaskHierarchy
ORDER BY levelnumber


Viewing all articles
Browse latest Browse all 1291

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>