Forums

This topic is locked

Question with INNER JOIN and DTS

Posted 22 Dec 2004 15:55:38
1
has voted
22 Dec 2004 15:55:38 colin hart posted:
I am building a website for a real estate company and I have two tables that I want to pertically merge. Table one is the property data and table two is the listing agent data. I used this query in my dts and i get about 35 of each record imported to the new table. It should only put one record in for every property record.

any suggestions?


SELECT ResDataComplete.AgentList, ResDataComplete.AmenitiesOther,
ResDataComplete.Appliances, ResDataComplete.BathsTotal, ResDataComplete.Beds,

ResDataComplete.City, ResDataComplete.CoolSystem,
ResDataComplete.Floors, ResDataComplete.ListDate, ResDataComplete.ListPrice,

ResDataComplete.ListStatus, ResDataComplete.MLSNum,
ResDataComplete.OfficeList, ResDataComplete.PropType, ResDataComplete.Roof,

ResDataComplete.SchoolHigh, ResDataComplete.SchoolJunior,
ResDataComplete.SqFtTotal, ResDataComplete.StreetName,

ResDataComplete.StreetNum, ResDataComplete.Amenities,
ResDataComplete.HeatSystem, ResDataComplete.NumGarages,

ResDataComplete.PropSubType, ResDataComplete.Remarks,
ResDataComplete.SchoolDistrict, ResDataComplete.SchoolElem,

ResDataComplete.State, ResDataComplete.YearBuilt,
ResDataComplete.ZipCode, OfficeData.OfficeName, OfficeData.Phone
FROM ResDataComplete INNER
JOIN
OfficeData ON ResDataComplete.OfficeList
= OfficeData.OfficeID
WHERE (ResDataComplete.City = 'AV')

Replies

Replied 07 Jan 2005 13:40:10
07 Jan 2005 13:40:10 Gerrit Meinders replied:
You should try changing SELECT into SELECT DISTINCT.

Hope that helps.

Reply to this topic