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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:29:51+00:00 2026-06-12T11:29:51+00:00

I have a basic level of SQL understanding, hence needing help and thanks in

  • 0

I have a basic level of SQL understanding, hence needing help and thanks in advance to those who reply.

I have 2 tables, one table contains Headings and Options that can be selected under those headings. The other table links to the actual data references of that table to reference the heading name and option.

I am trying to perform a SQL query to join these tables, then reference the parent/child ID’s in one table to pull the heading+selected option from the other table, but all I get back is the ID numbers. I’ve created a image that should explain what I’m trying to get back as a result.. and failing at badly!

This image here will explain:

http://i.imgur.com/hSPvY.jpg

NOTE – Above, where I say not 18 and 20, I can make my result show the ID numbers.. but not the correct info from the Parent title and Child title. (Server Support – Site Visits Chargable)

This is where I’ve gotten to with the SQL:

    SELECT custom_def_organizations.title
    FROM custom_data_organizations
    INNER JOIN organizations
    ON custom_data_organizations.organization_id = organizations.id
    INNER JOIN custom_def_organizations
    ON custom_def_organizations.parent_id = custom_data_organizations.root_field_id 
    AND custom_def_organizations.id = custom_data_organizations.field_id
  • 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-12T11:29:54+00:00Added an answer on June 12, 2026 at 11:29 am

    First query to join parent and child, without custom_data_organization but using the implied hierarchy:

    SELECT parent.id, child.id
        FROM custom_def_organizations AS parent
        JOIN custom_def_organizations AS child
            ON (child.parent_id = parent.id);
    

    This will return:

    18  19
    18  20
    18  21
    18  22
    18  23
    

    Now to fetch the other info:

    SELECT parent.id, child.id, CONCAT(parent.title, ' - ', child.title) AS title
        FROM custom_def_organizations AS parent
        JOIN custom_def_organizations AS child
            ON (child.parent_id = parent.id);
    

    This will return:

    18  19  Server Support - Yes
    18  20  Server Support - Site Visits Chargeable
    18  21  Server Support - Site Visits Included
    18  22  ...
    18  23
    

    The same concept but with custom_data_organizations driving the JOIN:

    SELECT cdo.id, CONCAT(parent.title, ' - ', child.title) AS title
        FROM custom_data_organizations AS cdo
        JOIN custom_def_organizations AS parent
            ON (cdo.root_field_id = parent.id)
        JOIN custom_def_organizations AS child
            ON (cdo.field_id = child.id);
    

    This will return:

        85    Server Support - Site Visits Chargeable
        ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As per my understanding, JDBC Connection Pooling (at a basic level) works this way:
I have a basic recursive table setup in SQL 2008 with the following structure:
I have a very basic UPDATE SQL - UPDATE HOLD_TABLE Q SET Q.TITLE =
Noob question. I have been programming at basic level for quite a while but
I have an interview coming up for an entry level pl/sql developer job. I
i have an object that, at its most basic level, looks like this: #include
I have an auto-generated SQL script with this basic structure: /* */ PRINT 'Stuff'
I have basic Spring MVC 3 setup for i18n where I can show labels
I have basic idea on Kilo Virtual Machine on Mobiles , I have clear
I have basic hello word example of Prime Faces. I have created dynamic web

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.