[Wolves] Happy Christmas ...and help me with this mysql query

Wayne Morris waynelists at machx.co.uk
Fri Dec 28 14:44:55 UTC 2012

On 27/12/2012 18:19, Andy Smith wrote:
<lots of useful stuff>

  I should clarify that Part1 on Item1 is not the same as Item1 on 
Part2, just the name is the same!
  So having a separate table for the Parts is a bit pointless.
Lets try again with houses, I want a list of unique houses at the end.

Each house has a distinct street address, possible same postcode (for 
two houses next door), same town.
Each house is broken up into Rooms - room1 -> room 14 (big apartment 

So all I did was set up one table for all 750 unique rooms, having ID,  
street address (address2) , Room No (address1) postcode as fields (and 
then sub tables for tenants, histories etc).

So, trying to get a list of each individual house (about 150) rather 
than each room

SELECT DISTINCT (address2 ) FROM property ORDER BY address2 LIMIT 0 , 
300 seems to produce a list of individual houses but

I can't populate the report as if i change it to:

SELECT DISTINCT (address2 ) FROM property as ID, address1, address2, 
rent ORDER BY address2 LIMIT 0 , 300
it goes balmy with duplicates

select * from property where address2 like '%1%'  would be really simple 
query if I could get rid of the duplicates caused by rooms over 10

More information about the Wolves mailing list