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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:00:31+00:00 2026-05-26T01:00:31+00:00

I have a fairly complex database question to ask so I shall try and

  • 0

I have a fairly complex database question to ask so I shall try and explain is as verbosely as possible.

I have one table called TypeAttributes.

typeID, attributeID, valueINT

From this table I wish to extract a certain type with a set of 6 attribute ID’s.

So, I wish to end up with something like this from a query searching for typeID, in the below case typeID = 11446

typeID, attributeID, valueINT
11446   182          3000      
11446   183          3001      
11446   184          3002      
11446   277          5         
11446   278          2         
11446   279          2         

From this information, I wish to then run the above query again, but with the valueINT of attributeID’s 182, 183 and 184 as the typeID to query. So, then I should end up with a table look like this:

typeID, attributeID, valueINT
11446   182          3000     
11446   183          3001      
11446   184          3002      
11446   277          5         
11446   278          2         
11446   279          2         
3000    182          1000      
3000    183          1001
3000    277          5
3000    278          5
3001    182          51951
3001    277          3
3002    182          1000
3002    277          2

In the end, what I’m hoping to have is all of the prerequisite typeID’s, 182 attribute values (which is actually a type of attribute im interested in),along side its secondary attribute (277).

From this data I should then be able to build a hierarchy of information simply from one item type. IE. I choose item type 11446, and it keeps going through the tree until there are no requisites.

Can this be done entirely in SQL to output a table like this?

I hope this makes some sense to someone.

Kind regards

PS.

As a side note, the attribute ID ties into another table which tells me which kind of attribute im looking at and the value is the value of that attribute, in this case, valueINT is actually another typeID I wish to lookup via the exact same process.

182, 183 and 184 are certain types and 277, 278 and 279 and multipliers of those types.

  • 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-05-26T01:00:32+00:00Added an answer on May 26, 2026 at 1:00 am

    You want to consider using a method called modified preorder traversal to store tree structured data – this method lets you easily find all nodes which a children of a given node to any depth in a single query.

    It seems you have several trees each defined by a particular attribute. Each of these attributes would be replaced by a pair of values to store a left and right node identifier.

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

Sidebar

Related Questions

I have a fairly complex LINQ to Entities query I'd like to try compiling
I have a fairly complex Core Data database with many entities, attributes and relationships.
I have a fairly complex database that needs to be deployed to a variety
I have a fairly complex OLAP database, which basically amounts to a header record,
I am fairly new to this discussion but I HAVE to ask this question
I have a fairly complex CLR stored procedure. What is the best way to
I have a fairly complex set of rewrite rules to give my site pages
I have a fairly complex html form enhanced via jquery. It has multiple tabs,
I have a fairly complex (or ugly depending on how you look at it)
So I have a fairly complex activity the parent being a linearlayout with a

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.