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

  • Home
  • SEARCH
  • 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 9023523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:46:52+00:00 2026-06-16T05:46:52+00:00

I have a database with a table which looks somewhat like this : Root

  • 0

I have a database with a table which looks somewhat like this :

Root   |   Connector
  A    |      B
  B    |      C
  C    |      D
  D    |      E
  E    |      -

So i want to retrieve the chain for any given root till the connector is blank

For example : Chain of A means a->B->C->D->E whereas Chain of C means C->D->E

I am using mysql database.

Thanks in advance

  • 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-16T05:46:53+00:00Added an answer on June 16, 2026 at 5:46 am

    I just try with loop structure in Mysql and got success. Posting to share only–

    CREATE PROCEDURE `root_connect`(IN init char(1),OUT str char(15))
    BEGIN
        set @startChar:=(select connector from tableName where root = init);
        set @endloop := "no";
        set @fullchar:= @startChar;
        set @newchar:= "";  
        if (@startChar !="-" OR @startChar =null) then 
            WHILE (@endloop = "no") DO                  
                set @newchar :=(select connector from tableName where root = @startChar);       
                if(@newchar = '-') THEN
                    set @endloop := "yes";
                else
                    set @fullchar:= concat(@fullchar,"-",@newchar);
                end if;         
                set @startChar := @newchar;     
            END WHILE;
        end if;
            select @fullchar;
    END
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database table that looks like this: CREATE TABLE IF NOT EXISTS
I want to design a table which looks something like this: avaya nchar(6) NOT
I'm using SQL Server 2008. I have a database table that looks like this
I have a database table looks like this: EVENT_ID TEXT_FRO TEXT_TO 55001 05 55001
I have a database in MYSQL and it has chat table which looks like
I have a legacy SQL schema which looks something like this: CREATE TABLE `User`
I have a Table which looks like this: --------------------------- |housing_id | facility_id | ---------------------------
I have a table which has one TEXT column that looks like this: 0-4
I have table consisting of notes for every user which looks like this: user_id
I have two tables in my database: test1 which looks like: ID pubmed_ID -------------------

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.