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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:49:39+00:00 2026-05-26T00:49:39+00:00

I have created a join for an application I am working on. SELECT community.id,

  • 0

I have created a join for an application I am working on.

SELECT community.id, 
       community.name, 
       property.type, 
       property.lowest_price, 
       property.highest_price,
       property.commission_rate,
       property.fixed_bonus 
  FROM community, 
       property 
 WHERE community.zip IN ($zips) 
   AND property.community_id = community.id

I am looking to select an additional value that requires following three relations and am unsure the best way to do that.

The value I want to get is builder_group.name

The community table has community.user_id which correlates with the builder table builder.user_id

The builder table also has a builder.builder_group_id which correlates with the builder_group table’s builder_group.id

The builder_group table finally has the value I want to select builder_group.name

Also, what is the best way to return the count for pagination purposes. Is it best to just do it once initially without returning columns and pass along at the PHP level or can it be returned with the SELECT without significant overhead?

  • 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-26T00:49:40+00:00Added an answer on May 26, 2026 at 12:49 am

    If you switch to explicit JOIN conditions, things become clearer:

    SELECT community.id, community.name,
           property.type, property.lowest_price, property.highest_price, property.commission_rate, property.fixed_bonus,
           builder_group.name
    FROM community
    JOIN property      on property.community_id = community.id
    JOIN builder       on builder.user_id = community.user_id
    JOIN builder_group on builder_group.id = builder.builder_group_id
    WHERE community.zip IN ($zips)
    

    If you’re worried about all those JOINs being slow then review the indexes on the columns involved in the join conditions (yet another reason to use explicit JOINs) and profile the query.

    As far as your pagination question goes, You might want to read about the FOUND_ROWS() function.

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

Sidebar

Related Questions

I have created a search functionality to my cake application. It is built from
I have created a few small flash widgets that stream .mp3 audio from an
I have a working Rails application on version 2.3.5 - I am using many
I have a web application and I am working on engine that analyzes referals.
I'm working on a Java Swing application. I have a button whose action runs
I have created a django application. The application has a registration form. I inserted
public List findCatalog() { Query query = getEntityManager().createQuery(SELECT pc.productCatalog, p.name, p.product FROM ProductCatalog pc
I'm having a hard time with this join query in my application. I have
I am trying to get dynamic select menu's working in my Rails application. I
Have created a c++ implementation of the Hough transform for detecting lines in images.

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.