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 8743733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:43:45+00:00 2026-06-13T11:43:45+00:00

I want to read items from SQL table which are in Hierarchical manner. e.g.

  • 0

I want to read items from SQL table which are in Hierarchical manner. e.g. My table having Parent-Child relations.
Following is my table structure:

id    name    parentId

1     abc      null

2     xyz        1

3     lmn        1

4     qwe       null

5     asd        4

So I want to load all the Item hierarchically in one go, How can I do that?
I tried HashMap but it feels very complex….
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-13T11:43:46+00:00Added an answer on June 13, 2026 at 11:43 am

    You can retrieve the whole hierarchy through one SQL query, but the query depends on the database system – for instance, Oracle supports a “CONNECT BY” query for hierarchical queries. MySQL does not support this directly – but there are some very good approaches explained at Hierachical Queries in MySQL. I suggest that you try one of these. The basic approach is to create a function which imitates the CONNECT BY.

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

Sidebar

Related Questions

I'm having trouble converting the following SQL-statement to LINQ-to-entities: SELECT l.* FROM locations l
I want to read a INI file from python, and I came up with
I want to read the pdf file from raw folder if devices have any
I want to read .ppt files from the iPhone mail app. I have already
I'm having a bit of trouble with knowing how I can save items from
I have an XML structure like the following: <tables> <table name=tableName1> <row ID=34 col1=data
I have the following tables: users userId|name items itemId|userId|description What I want to achieve:
I have a Hierarchical Table for Categories in this form NodeID ParentID NodeName Following
I have some html content in a SQL Server column, I want to read
I have the following 2 tables defined in a SQL Server database: CREATE TABLE

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.