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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:36:33+00:00 2026-05-25T00:36:33+00:00

EDIT : The answers works, but slow down the query a lot. Is there

  • 0

EDIT: The answers works, but slow down the query a lot. Is there another solution?


I have the following object in my program.

Page haves various TextBlock that haves various Token.

The three are stored in the database in three tables with the same namas of the objects.

I want to know if is possible to recover all the data needed to fill the object in the program with only one query.

I want only one query because I’m using a CURSOR to iterate over all the objects stored in the database.

The database scheme is this:

Page(id, someAttributes)
TextBlock(id,pageId, someAttributes)
Token(textblockId, someAttributes)

  • 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-25T00:36:34+00:00Added an answer on May 25, 2026 at 12:36 am

    Assuming that every Page has at least one Textblock with at least one Token each try

    SELECT * FROM
    Page AS P 
    INNER JOIN TextBlock T ON T.pageId = P.id 
    INNER JOIN Token TK ON TK.textblockId = T.id;
    

    Alternatively (old syntax):

    SELECT * FROM
    Page AS P, TextBlock T, Token TK WHERE 
    T.pageId = P.id AND
    TK.textblockId = T.id;
    

    IF it is possible that the above condition is not always true then you need to use OUTER JOIN instead of INNER JOIN.

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

Sidebar

Related Questions

FINAL EDIT: After following the answer from Darin Dimitrov, I have found that the
i have a program(winform) that runs through a lot of files(in the area of
I have read a lot of the similar questions but I can't find my
I have the following SQL query to return all Customers who have no OrderLines
Please note the Edit below for a lot more information, and a possible solution
There seem to be a million questions (and answers) about this, but none of
EDIT 2 Okay, based on the advice on the answers below I eliminated my
Why new()/delete() is slower than malloc()/free()? EDIT: Thanks for the answers so far. Please
EDIT : Accepted answer points out what my issue was. I added another answer
EDIT: See my answer below--> I am wanting to have a view that when

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.