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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:16:34+00:00 2026-05-27T22:16:34+00:00

I have an interesting situation – I have multiple properties on our system, some

  • 0

I have an interesting situation – I have multiple properties on our system, some of them share the same address. So if the number column as well as the street column matches in value (I will be using LOWER() as a processor for the string columns) I want the IDs of these rows. ALSO I need to exclude rows that do not have matches.

The problem is that, as I understand it, if I use the GROUP BY command, it will not retrieve the IDs of each homes row that match the criteria.. What’s my alternative? I could of course write a PHP script that stores all the address combos in an array and then pick out the duplicates to re-group the IDs, but I’m hoping there’s a simpler way.

So far the MySQL query I have is

SELECT COUNT(*) as cnt, id FROM homes GROUP BY number, street WHERE cnt>1

But it does NOT work… I’m not sure if I’m using the cnt>1 part correctly.

EDIT:

Here’s how my table looks like (desc homes result)

SQL query: desc homes; 
Rows: 72
Field Type Null Key Default Extra
id int(11) NO PRI NULL auto_increment
masterid int(11) NO NULL
source int(11) NO MUL 0
firm_1 varchar(255) NO NULL
firm_2 varchar(255) NO NULL
firm_1_id varchar(255) NO MUL NULL
firm_2_id varchar(255) NO NULL
firm_phone_1 varchar(255) NO NULL
firm_phone_2 varchar(255) NO NULL
firm_fax_1 varchar(255) NO NULL
firm_fax_2 varchar(255) NO NULL
realtor_1 varchar(255) NO NULL
realtor_2 varchar(255) NO NULL
realtor_phone_1 varchar(255) NO NULL
realtor_phone_2 varchar(255) NO NULL
create_date datetime NO NULL
modify_date datetime NO NULL
lat varchar(255) NO MUL
long varchar(255) NO MUL
sold varchar(255) NO MUL
feature int(1) NO MUL 0
mls varchar(10) NO MUL
ord decimal(7,2) NO 0.00
type varchar(255) NO MUL 0
building varchar(255) NO
price varchar(255) NO
prevprice varchar(255) NO
showaddress enum('0','1') NO 1
unit varchar(255) NO
number varchar(255) NO
street varchar(255) NO
area varchar(255) NO MUL
city varchar(255) NO MUL
openhouse varchar(255) NO
videolink varchar(255) NO
youtube varchar(255) YES NULL
youtube1 varchar(255) YES NULL
remarks int(11) NO 0
bedroom varchar(255) NO
bathroom varchar(255) NO
sqftup varchar(255) NO
sqftmain varchar(255) NO
sqftdown varchar(255) NO
fullbath varchar(255) NO
halfbath varchar(255) NO
kitchen varchar(255) NO
fireplace varchar(255) NO
parking varchar(255) NO
storage varchar(255) NO
style varchar(255) NO NULL
tax varchar(255) NO
maintenance varchar(255) NO NULL
warranty varchar(255) NO NULL
sqft varchar(255) NO
lot varchar(255) NO
depth varchar(255) NO NULL
rearexposure varchar(255) NO NULL
basement varchar(255) NO NULL
suite varchar(255) NO NULL
view varchar(255) NO NULL
balcony varchar(255) NO NULL
rental varchar(255) NO NULL
construction varchar(255) NO NULL
frontage varchar(255) NO
story varchar(255) NO
year varchar(255) NO
description text NO NULL
description2 text NO NULL
dimension text NO NULL
heading varchar(255) NO
publish enum('0','1') NO MUL 0
views int(11) NO 0
  • 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-27T22:16:34+00:00Added an answer on May 27, 2026 at 10:16 pm

    You can keep ids with mysql group_concat function agGregation:

    SELECT 
      COUNT(*) as cnt, 
      group_concat( cast(Id as char) ) as ids 
    FROM 
      homes 
    GROUP BY 
      number, street 
    HAVING
      COUNT(*) > 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just found an interesting situation. Suppose you have some SwingWorker (I've made this
I have an interesting situation. In some (large) legacy code, there is a namespace
We have an interesting situation. Our build server seems to want to go back
I have an interesting situation where I need to deploy an ASP.NET MVC app
I have somewhat interesting development situation. The client and deployment server are inside a
I just came across an interesting situation in JavaScript. I have a class with
I have, what I believe to be, an interesting situation at hand. I have
I have one interesting problem. I must parse mail body (regular expression), get some
I have some interesting problem for an hour.. In my flex project, all width
I have an interesting situation, well it's probably not that unique at all, but

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.