Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 26th, 2004, 07:40 PM
Registered User
 
Join Date: Aug 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default INNER JOIN

I have lost my mind on this one.

I have used the inner join successfully on a portion of my site but I've run into a bit of a snag.

Tables & Fields
PropertyInfo - Contains property information
     [u]PropertyID</u>, [u]ContactID</u>, Address, Price.....

ContactInfo - Contains Contact Information which a person could be the contact for more than one property
     [u]ContactID</u>, ContactName, ContactPhone...

PropFeatures - Contains property features which can contain multiple features for each one property
     [u]PropertyID</u>, Feature, FeautreDesc...

I have been able to create the INNER JOIN for PropertyInfo & ContactInfo as shown below.

"SELECT PropertyInfo.PropertyID, PropertyInfo.ContactID, ContactInfo.ContactID, " & _
"PropertyInfo.MLSNo, PropertyInfo.StreetAddress, PropertyInfo.UnitNumber, PropertyInfo.City, PropertyInfo.State, " &_
"ContactInfo.ContactName, ContactInfo.ContactPhone1, ContactInfo.ContactPhone2, ContactInfo.ContactEmail, " & _
" FROM ContactInfo INNER JOIN PropertyInfo ON ContactInfo.ContactID = PropertyInfo.ContactID " & _
"WHERE (PropertyInfo.PropertyID LIKE '" & strPropertyID & "')"

Now I need to add the PropFeatures Table to the Query. When I do, it repeats the Property Information for each Feature in PropFeatures.

Help...

[email protected]
 
Old August 26th, 2004, 09:25 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Default

Well when you join it that is exactly what is suppose to happen. So the question is, what do you want to show from the PropFeatures table?

 
Old August 29th, 2004, 09:30 AM
Registered User
 
Join Date: Aug 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What I need it to do is to list the property once and the features that belong to that property.

PropID StreetAddress Features
12345 123 Any Street Pool
                            Washer & Dryer
                            Fireplace
                            Fenced Yard

 
Old August 29th, 2004, 12:28 PM
Registered User
 
Join Date: Aug 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Never Mind - I figured it out.

It wasn't the query but where I had the Whild...Wend






Similar Threads
Thread Thread Starter Forum Replies Last Post
I'm new to join oneilsteven BOOK: ASP.NET Website Programming Problem-Design-Solution 0 February 9th, 2008 06:07 PM
join dhara_adh SQL Server 2000 2 January 2nd, 2007 12:39 AM
Join or not join madhukp SQL Server 2000 3 February 2nd, 2005 01:11 AM
More than one join jaywhy13 Classic ASP Basics 2 January 31st, 2005 11:38 PM
Oracle 8i inner join and left join problem puteri_84 Oracle 2 August 19th, 2004 07:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.