Steve
Rhino wrote:
----- Original Message ----- From: "Steve Grosz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 11, 2004 3:57 PM
Subject: Strange results
I'm curious, why if I enter this code:
select * from vendor left outer join model on vendor.PID=model.VendorID left outer join specs on model.Model=specs.ProdModel where vendor.Vendor='#URL.Vendor#'
do I get the results like: http://www.scootervilleusa.com/test1.cfm?Vendor=Tank
I simply want 1 row for each product to be displayed, not 4 sets of 4
rows.
It's hard to say for sure without seeing your table definitions and a sampling of the data in each table but I think there's a very good chance that either one of your tables doesn't have a primary key defined or that you are not joining on the primary key in one of your joins.
Joins typically take place between a primary key on one table and a corresponding foreign key on the other table. The syntax of your joins seems fine so I can only suspect the two things I said above. For instance, if Vendor.PID is intended to be unique and you think of it as the primary key but it hasn't actually been defined that way in the table, it's very possible that this is causing your duplicate rows.
Rhino
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]