Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9210111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:59:36+00:00 2026-06-18T00:59:36+00:00

I have the following data: I would like to express the FTSEAllShare in terms

  • 0

I have the following data:

enter image description here

I would like to express the FTSEAllShare in terms of all its primitives (ie. Corp1, Corp2, Corp3, Corp4).
I’ve written a WHILE loop that repeatedly SELF JOINs MemberName to GroupName and COALESCEs the resulting MemberName, but I’ve been reading about recursive CTEs and thought that they may offer a simpler way of doing it.

I’m not good with recursive code and I find myself getting confused everytime I try.

Could someone please help me out with this and suggest how I may use a recursive CTE to express the FTSEAllShare in terms of its 4 primitives?

Kind regards

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:59:37+00:00Added an answer on June 18, 2026 at 12:59 am

    Like this:

    WITH CTE
    AS
    (
      SELECT GroupName, MemberName, 0 AS Level
      FROM GroupsMembers 
      WHERE GroupName = 'FRSEAllShare'
      UNION ALL
      SELECT g.*, c.level + 1
      FROM CTE c
      INNER JOIN GroupsMembers g ON c.MemberName = g.GroupName
    )
    SELECT * 
    FROM CTE;
    

    Live Demo

    This will give you all the members that belongs to the group FRSEAllShare, or any of its grandchilds groups, with a new column level to select them by level.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following data test<-data.frame(group=1:10, var.a=rnorm(n=10,mean=500,sd=20), var.b=runif(10)) I would like a barplot with
I have the following data frame from which I would like to extract rows
I have simple OneToOne relationship: Data <-> TherapyResult I would like to express the
I have the following data (from a text file), I would like to split
I have the following plot of data: I would like to have month labels
I have the following data strucutre outputting form my Schema in a node/express app.
Given a table of input data I would like to have a set o
I have following data in database: 1 2 3 4 5 And I would
I have following data frames > head(elo) date elo 1 1921-12-18 1597 2 1922-05-14
I have following data structure (simplified): A giant list of the class TestClass public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.