title: How to get level and count for item in recursive query
body: <pre><code>WITH cte(folder_id, parent_id, folder_name)
  AS
  (
      select folder.folder_id, folder.parent_id, folder.folder_name
      FROM Folder_Table [folder] 
          JOIN File_Table [file] on [folder].[folder_id] = [file].[folder_id]
      union all
      select Folder_Table.folder_id,Folder_Table.parent_id,Folder_Table.folder_name
      from cte 
          join Folder_Table on cte.parent_id = Folder_Table.folder_id
  )
  SELECT distinct * FROM cte
  </code></pre>
  
  <p>at this query i need to get the level of items and the count of child at the level 
  if have child </p>