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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:24:44+00:00 2026-05-26T06:24:44+00:00

I have two tables table COMMUNITY id, name, etc. table PROPERTY id, community_id, type,

  • 0

I have two tables

table COMMUNITY
  id, 
  name, 
  etc.

table PROPERTY
  id,
  community_id,
  type,
  price,
  rate,
  etc.

There are four possible property types and a community can have info for one or more of the different types.

I am trying to figure out how to combine the information for each community into one row.
For instance I might want to get a row which includes

community.id, community.name, condo.price, condo.rate, town_home.price, town_home.rate

Of course there aren’t tables for condo or town_home, the property type is represented in the property table by a column and a community can have multiple property rows.

My first thought was to use multiple joins on the table with aliases, but I can’t seem to get anything that works properly.

Any suggestions?

  • 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-26T06:24:44+00:00Added an answer on May 26, 2026 at 6:24 am

    You can use left join for this.

    SELECT c.id, c.name, condo.price, condo.rate, town_home.price, town_home.rate
    FROM Community c
    LEFT JOIN Property condo ON condo.community_id = c.id AND condo.type = 'condo'
    LEFT JOIN Property town_home ON town_home.community_id = c.id AND town_home.type = 'town_home'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables: Table 1: ID, PersonCode, Name, Table 2: ID, Table1ID, Location,
I have two tables, for example: Table A Table B ======= ======= Name |
I have two tables Table FOO FooUniqueID| Year| Name| Worth| --------------------------- 1 2008 Bob
I have two tables Table Name: Graph UID1 UID2 ----------- 12 23 12 32
I have two tables: Table A: id name ------------ 1 Scott 2 Dan 3
I have two tables: table 1 fid field queryorder table 2 fid field name
So here's the setup. I have two tables: CREATE TABLE dbo.TmpFeesToRules1(Name varchar, LookupId int)
I have two tables: a Files table, which includes the file type, and a
I have two tables Table : 1, Name : NdcAwp, Columns-Ndc, AwpUnitCost Table :
I have two tables Table Visitor ID Name CityName 1 Jon NY 1 Jon

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.