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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:40:21+00:00 2026-06-17T05:40:21+00:00

Hey i am trying to query my database tables that are set up in

  • 0

Hey i am trying to query my database tables that are set up in a many to many relationship with a table between. here is a quick erd of the tables in question

 Homes ----<  Home_Feature  >---- Features

I have tried creating the below sql query but is there a way to return one row for each home instead of the many that are returned here? Or do do i have to change my table structures to accommodate a better solution?

 SELECT homes.title, homes.description, homes.living_room_count, homes.bedroom_count, homes.bathroom_count, features.feature_name
 FROM homes
 INNER JOIN home_feature
 ON homes.home_id = home_feature.home_id
 INNER JOIN features
 ON home_feature.feature_id = features.feature_id;

Output from query:

    Title     Feature   ....
 1  House A   Balcony    
 2  House A   Pool
 3  House A   Garage
 4  House B   Air-Con

Thank you, any help appreciated!

  ____________________EDIT__________________________

Hey i greatly appreciate the help you guys have given so far and was wondering if i could have a little more help with regards to adding to this query and selecting columns from another table.

When i simply add the column of the other table in the SELECT statement and the table in the FROM clause the query seems to not work? the query im using is below but doesn’t work. Thanks again for the help.

SELECT homes.title, homes.description, homes.living_room_count, homes.bedroom_count, homes.bathroom_count, homes.price, homes.sqft, home_type.type_name,
    listagg(features.feature_name, ',') WITHIN GROUP (ORDER BY features.feature_name)  features
FROM homes, home_type
INNER JOIN home_feature
ON homes.home_id = home_feature.home_id
INNER JOIN features
ON home_feature.feature_id = features.feature_id
GROUP BY homes.title, homes.description, homes.living_room_count, homes.bedroom_count, homes.bathroom_count, homes.price, homes.sqft;

I get this error:

ORA-00904: "HOMES"."HOME_ID": invalid identifier
00904. 00000 -  "%s: invalid identifier"
  • 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-17T05:40:22+00:00Added an answer on June 17, 2026 at 5:40 am

    Oracle 10g version:

    SQL> SELECT homes.title, homes.living_room_count, homes.bedroom_count, homes.bathroom_count,
      2         wm_concat(features.feature_name) features
      3    FROM homes
      4         INNER JOIN home_feature
      5                 ON homes.home_id = home_feature.home_id
      6         INNER JOIN features
      7                 ON home_feature.feature_id = features.feature_id
      8   group by homes.title, homes.living_room_count, homes.bedroom_count, homes.bathroom_count;
    
    TITLE   LIVING_ROOM_COUNT BEDROOM_COUNT BATHROOM_COUNT FEATURES
    ------- ----------------- ------------- -------------- ------------------------------
    House A                 1             3              1 Balcony,Pool,Garage
    House B                 1             2              2 Air-Con
    

    and 11g we can use listagg:

    SQL> SELECT homes.title, homes.living_room_count, homes.bedroom_count, homes.bathroom_count,
      2         listagg(features.feature_name, ',') within group (order by features.feature_name)  features
      3    FROM homes
      4         INNER JOIN home_feature
      5                 ON homes.home_id = home_feature.home_id
      6         INNER JOIN features
      7                 ON home_feature.feature_id = features.feature_id
      8   group by homes.title, homes.living_room_count, homes.bedroom_count, homes.bathroom_count;
    
    TITLE   LIVING_ROOM_COUNT BEDROOM_COUNT BATHROOM_COUNT FEATURES
    ------- ----------------- ------------- -------------- ------------------------------
    House A                 1             3              1 Balcony,Garage,Pool
    House B                 1             2              2 Air-Con
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey All! I'm trying to construct a query that is something like this: Where
Hey All you out there, I am trying to write a query that sums
Hey I am trying to do a sub query that allows me to get
Hey guys i'm trying to connect to my database and run a query. it
Hey guys I am getting this exception when trying to run the query Column
Hey I'm trying to figure out how to convert a statement that works in
Hey all i im getting this error when trying to update a table in
Hey I am trying to make a page that inserts some strings into a
Hey everyone, I am trying to figure out a way to query my mysql
Hey guys im trying to connect to an database and collect some data out

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.